{source}
<?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");
?>
<html>
<head>
<title>جامعة الاسكندرية</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/http://alexu.edu.eg/Apps/js/jquery.js"></script>
<script type="text/javascript" src="/http://alexu.edu.eg/Apps/DataTables/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="/https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<link rel="shortcut icon" type="image/png" href="/http://alexu.edu.eg/Apps/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="/http://alexu.edu.eg/Apps/style.css">
<link rel="stylesheet" type="text/css" href="/http://alexu.edu.eg/Apps/DataTables/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="/https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css"/>
<script type="text/javascript">
$(document).ready(function(){
function search(){
var code=$("#searchByCode").val();
var name=$("#searchByName").val();
var fac = $("#facultysapp option:selected").attr("id")
$("#result").html('<img alt="ajax search" src="/http://alexu.edu.eg/Apps/ajax-loader.gif"/>');
$.ajax({
type:"post",
//dataType: "jsonp",
url:"http://alexu.edu.eg/Apps/CourseSearch.php",
encoding:"UTF-8",
data:{"code":code, "name":name, "fac":fac},
success:function(data){
$("#result").html(data);
$('#example').DataTable();
$('#example_length').hide();
$('#example_filter').hide();
}
});
}
$("#button").click(function(){
search();
});
$('#search').keyup(function(e) {
if(e.keyCode == 13) {
search();
}
});
});
</script>
</head>
<body>
<p id="heading">المقررات الدراسية - جامعة الاسكندرية</p>
<center>
<div id="select_box" style="overflow-x:auto;">
<!-- **************************************************************** -->
<div id="searchBox">
<input type="text" id="searchByCode" placeholder="البحث بـ كود المقرر"/>
<input type="text" id="searchByName" placeholder="أكتب أول أحرف من اسم المقرر"/>
<!-- **************************************************************** -->
<select id="facultysapp" onchange="fetch_select_dep(value);">
<option>
اختر الكلية
</option>
<?php
$select=mysqli_query($con,"select fid, fname_ar from faculties group by fid");
while($row=mysqli_fetch_array($select))
{
echo "<option id=".$row['fid'].">".$row['fname_ar']."</option>";
}
?>
</select>
<!-- **************************************************************** -->
<input type="button" id="button" value="Search" />
</div>
<hr>
<h4>نتائج البحث</h4>
<hr>
<div id="resultBox">
<table cellspacing="0" width="100%" id="example" class="table table-striped table-hover table-responsive" border="1" frame="void" rules="rows">
<thead>
<tr>
<th>المقرر</th>
<th>الكلية</th>
<th>اللائحة الدراسية</th>
<th>الفصل الدرااسي</th>
<th>نوع الدراسة</th>
<th>البرنامج الدراسي</th>
</tr>
</thead>
<tbody id="result">
</tbody>
</table>
</div>
</div>
</center>
</body>
</html>
{/source}