function GetCostCode() { $where = 'where cc.globality ="GLOBAL" AND cc.IsActive="YES" '; if (isset($_REQUEST['CostID']) && $_REQUEST['CostID'] != NULL) { $where .= ' AND CostID=' . $_REQUEST['CostID']; } $whereParam = array(); if (isset($_REQUEST["query"]) && $_REQUEST["query"] != "") { $where .= " AND (cc.CostCode LIKE :qry )"; $whereParam = array(":qry" => $_REQUEST["query"] . "%"); } $temp = manage_salary_item_type::GetAllCostCode($where, $whereParam); $no = count($temp); $temp = array_slice($temp, $_GET["start"], $_GET["limit"]); echo dataReader::getJsonData($temp, $no, $_GET["callback"]); die; }