Location: PHPKode > projects > Todo Manager > todo/classes/util.class.php
<?php
require_once $_SERVER["DOCUMENT_ROOT"]."/".FOLDER."/classes/database.class.php";
require_once $_SERVER["DOCUMENT_ROOT"]."/".FOLDER."/classes/activerecord.class.php";

class Util {

	function getUsers($db) {
		$ret = array();
		
		$sql = "
		select
			id,
			username
		from user
		order by username";
		$result = $db->getResult($sql);
		while ($row = $db->getRow($result))
			array_push($ret, $row);
		
		return $ret;
	}
	
	function getProjects($db) {
		$ret = array();
		
		$sql = "
		select
			id,
			created_on,
			title,
			status
		from project
		order by title";
		$result = $db->getResult($sql);
		while ($row = $db->getRow($result))
			array_push($ret, $row);
		
		return $ret;
	}
	
}
?>
Return current item: Todo Manager