<?php 
$user_role = $_SESSION['role_id'];
/*=================================*/
	$pos_la = mysql_real_escape_string(stripslashes($_GET['pos_la']));
	
	// -------------------------------------------	
$whereclause = "";
if ($pos_la != NULL) $whereclause .= " AND orgname LIKE '%$pos_la%' ";

if ($whereclause != "") $whereclause = "WHERE " . substr($whereclause, 0, strlen($whereclause)-5);


$params = "";
if ($pos_la != NULL) $params .= "pos_la=$pos_la&";
	
// ------------------------------------- PAGE ------------------------------ //
$pagesize = 10;
$start =  (int)$_GET['start'];
	
$limitclause = "LIMIT $start, $pagesize";

// --------------------------------------------------------- Build Paging
$eqcount = nr_execute("SELECT COUNT(*) FROM organization  $whereclause");
$pagecount = ceil($eqcount / $pagesize);
$pagenum = floor($start/$pagesize) +1;
$starttext = $start+1;
$endtext = min($start + $pagesize, $eqcount);
$pagedescription = "ຫນ້າທີ $pagenum, ສະແດງລາຍການທີ $starttext ຫາ $endtext, ຈາກທັງຫມົດ $eqcount ລາຍການ";		
		
function LoadEq($whereclause, $limitclause) {
	return mysql_query("select * from organization  $whereclause ORDER BY orgname ASC $limitclause");
}
