/** * Return an array containing the ids and names of all parent resources for this resource * * @return Array an array of all parent resources, the key is the id of the resource while the value is the name of the resource */ function getAllParentResources() { $parentquery = "SELECT r.name AS optiontext, r.id AS optionvalue FROM aclresource AS r ORDER BY optiontext"; if (!isEmptyString($this->getID())) { $parentquery .= " AND id <> '" . $this->getID() . "'"; } return getOptionValuesFromDatabaseQuery($parentquery); }
/** * Return the values of the options for the lookup type * * @return Array containing the lookup types for the values or false if an error occurs * */ function getOptionValuesFromQuery() { # get the query to execute $conn = Doctrine_Manager::connection(); $query = $conn->fetchRow("SELECT querystring FROM lookupquery WHERE name = '" . $this->getName() . "'"); # debugMessage($query); if (isEmptyString($query['querystring'])) { return array(); } else { return getOptionValuesFromDatabaseQuery($query['querystring']); } }
function getAllcurrencies() { $query = "SELECT Currency AS optionvalue, Currency AS optiontext FROM shipmentcurrency where CompanyID='" . $_SESSION['UserID'] . "' ORDER BY Currency"; return getOptionValuesFromDatabaseQuery($query); }
function getPayrollReports($value = '', $checkempty = false) { $query = "SELECT p.id as optionvalue, concat('Payroll (', DATE_FORMAT(p.startdate, '%b %D'), ' - ', DATE_FORMAT(p.enddate, '%b %D'),')') as optiontext FROM payroll p where p.status = 2 order by optiontext "; $array = getOptionValuesFromDatabaseQuery($query); return $array; }
function getAllservice() { $query = "SELECT name AS optionvalue, name AS optiontext FROM service_list ORDER BY name"; return getOptionValuesFromDatabaseQuery($query); }