managerecruit.blade.php
1.42 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
<?php
if(isset($_POST['rsstring']))
{
$searchstr=Input::get('rsstring');
if($searchstr!="")
{
$searchresultH='<table class="footable table" cellpadding="0" cellspacing="0" style="border-bottom:black 2px solid;margin-bottom:20px"><thead><tr>
<th>ID</th>
<th>Name</th>
<th>Values</th>
</tr></thead>';
//recruits
$users=$wakka->getPersons(likeQuery($searchstr,'peopledata','and')." and ".likeQuery("status:recruit",'peopledata','and')." limit 20");
foreach($users as $user){$ppldata=unserialize($user['peopledata']);$searchresult.="<tr onclick='showRecruit($user[id]);'><td>$user[id]</td><td>".$ppldata['firstname']." ".$ppldata['lastname']."</td><td>[".$ppldata['nationality'].":".$ppldata['passportno'].":".$ppldata['currentstatus']."] Mob:".$ppldata['mobile'].", Client:".$ppldata['client']."</td></tr>";}
$searchresultF.='</table>';
if($searchresult!="")$searchresult=$searchresultH.$searchresult.$searchresultF;
else $searchresult="<h2>No Records Found!</h2>";
echo $searchresult;
}
}
else
{
?>
<h2>Search Recruits</h2>
<input type=text class=mf name=recruitsearch id=recruitsearch onkeyup="searchRecruit(this.value);">
<div id=recruitresult style='display:none'></div>
<?php
}
function likeQuery($searchstr,$col,$join)
{
$likequery=array();
$searchTerms=explode(",",$searchstr);
foreach($searchTerms as $sterm)$likequery[]="$col like '%$sterm%'";
return " (".implode(" $join ",$likequery).") ";
}
?>