-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearch.php
More file actions
99 lines (93 loc) · 2.49 KB
/
Copy pathSearch.php
File metadata and controls
99 lines (93 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
session_start();
include('config/config1.php');
$member_id = $_SESSION['login_user_id'];
//$search=$_REQUEST['search'];
$q = strtolower($_POST["keyword"]);
?>
<link href="css/form.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>
var q='<?php echo $q;?>';
$(document).ready(function(){
searchComment();
searchVideo();
searchFriends();
});
function searchComment()
{
$.ajax({
type: "POST",
url: 'ajax/searchComments.php',
data: 'keyword='+q,
success: function(data) {
$('#dv_cmnt').html(data);
},
error: function(e) {
$('#dv_cmnt').html("<strong style='color:red;'>There is somme error in the network. Please try later.</strong>");
}
});
}
function searchVideo()
{
$.ajax({
type: "POST",
url: 'ajax/searchVideo.php',
data: 'keyword='+q,
success: function(data) {
$('#dv_video').html(data);
},
error: function(e) {
$('#dv_video').html("<strong style='color:red;'>There is somme error in the network. Please try later.</strong>");
}
});
}
function searchFriends()
{
$.ajax({
type: "POST",
url: 'ajax/searchFriends.php',
data: 'keyword='+q,
success: function(data) {
$('#dv_user').html(data);
},
error: function(e) {
$('#dv_user').html("<strong style='color:red;'>There is somme error in the network. Please try later.</strong>");
}
});
}
/*function addFriend(frndFromID,frndToID,src)
{
$.ajax({
type: "POST",
url: 'ajax/confirmfriendInAjax.php',
data: 'fromID='+frndFromID+'&toID='+frndToID+'&rtype=n',
success: function(data) {
$(src).parent().html("<strong >Friend Request Sent</strong>");
},
error: function(e) {
alert("There is somme error in the network. Please try later.");
}
});
}*/
</script>
<div id="lightbox_form" style="width: 873px;">
<form id="search" name="search" method="POST" action="home.php">
<div class="form_pad" >
<div class="search1">
<div style="width: 220px; float: left; padding: 10px;" id="dv_user" >
<h1>Friends</h1>
<div style='padding: 5px ;'><img src='ajax-loader.gif' alt='Loading...' /></div>
</div>
<div style="width: 300px; float: left; padding: 10px; " id="dv_video">
<h1>Videos</h1>
<div style='padding: 5px ;'><img src='ajax-loader.gif' alt='Loading...' /></div>
</div>
<div style="width: 280px; float: left; padding: 10px;" id="dv_cmnt">
<h1>Comments</h1>
<div style='padding: 5px ;'><img src='ajax-loader.gif' alt='Loading...' /></div>
</div>
</div>
</div>
</form>
</div>