include("admin/classes/initial.php"); include("admin/classes/config.php"); $SearchString = trim($_REQUEST['SearchString']); $CategoryId = trim($_REQUEST['CategoryId']); $Country = trim($_REQUEST['Country']); $EmployeeStrength = trim($_REQUEST['EmployeeStrength']); $rowperpage = 9; $sql ="select a.*,b.EmployeeStrength,c.Category from companies a join employeestrenths b on b.EmployeeStrengthId=a.EmployeeStrength join categories c on c.CategoryId=a.CategoryId where 1=1 "; if ($SearchString!="") { $sql .= " and a.Company like '".mysqli_real_escape_string($con,$SearchString)."%' "; } if ($CategoryId!="") { $sql .= " and a.CategoryId='".mysqli_real_escape_string($con,$CategoryId)."' "; } if ($Country!="") { $sql .= " and a.Country='".mysqli_real_escape_string($con,$Country)."' "; } if ($EmployeeStrength!="") { $sql .= " and a.EmployeeStrength='".mysqli_real_escape_string($con,$EmployeeStrength)."' "; } $sql .= " order by a.CreatedOn asc limit 0, $rowperpage "; $rsq = mysqli_query($con,$sql); $allcount_query ="select count(*) as allcount from companies a join employeestrenths b on b.EmployeeStrengthId=a.EmployeeStrength join categories c on c.CategoryId=a.CategoryId where 1=1 "; if ($SearchString!="") { $sql .= " and a.Company like '".mysqli_real_escape_string($con,$SearchString)."%' "; } if ($CategoryId!="") { $sql .= " and a.CategoryId='".mysqli_real_escape_string($con,$CategoryId)."' "; } if ($Country!="") { $sql .= " and a.Country='".mysqli_real_escape_string($con,$Country)."' "; } if ($EmployeeStrength!="") { $sql .= " and a.EmployeeStrength='".mysqli_real_escape_string($con,$EmployeeStrength)."' "; } $allcount_result = mysqli_query($con,$allcount_query); $allcount_fetch = mysqli_fetch_array($allcount_result); $allcount = $allcount_fetch['allcount']; ?>