function searchOD($page = 0, $condition, $searchKey) { if ($page > 0) { $page = ($page - 1) * PAGE_BY; $condition = "LIMIT {$page}," . PAGE_BY; } $fields = array(COMPANY_TABLE . ".companyName", PERSON_TABLE . ".lastName", PERSON_TABLE . ".middleName", PERSON_TABLE . ".firstName", LOCATIONADDRESS_TABLE . ".number", LOCATIONADDRESS_TABLE . ".street", BARANGAY_TABLE . ".code", LOCATIONADDRESS_TABLE . ".district", LOCATIONADDRESS_TABLE . ".municipalityCity", LOCATIONADDRESS_TABLE . ".province"); $odRecords = new ODRecords(); if ($odRecords->searchRecords($searchKey, $fields, $condition)) { if (!($domDoc = $odRecords->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } } else { return false; } }
function searchOD($page = 0, $searchKey, $condition = "") { if ($page > 0) { $page = ($page - 1) * PAGE_BY; $condition .= " LIMIT {$page}," . PAGE_BY; } $fields = array(COMPANY_TABLE . ".companyName", PERSON_TABLE . ".lastName", PERSON_TABLE . ".middleName", PERSON_TABLE . ".firstName", LOCATIONADDRESS_TABLE . ".number", LOCATIONADDRESS_TABLE . ".street", BARANGAY_TABLE . ".description", DISTRICT_TABLE . ".description", MUNICIPALITYCITY_TABLE . ".description", PROVINCE_TABLE . ".description"); $odRecords = new ODRecords(); if ($odRecords->searchRecords($searchKey, $fields, $condition)) { if (!($domDoc = $odRecords->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } } else { return false; } }