managerecruit.blade.php 1.42 KB
<?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).") ";
}
?>