public function timeSheet_get_data($timeEntryID)
{
$timeEntryID = MySQL::SQLValue($timeEntryID, MySQL::SQLVALUE_NUMBER);
$table = $this->getTimeSheetTable();
$projectTable = $this->getProjectTable();
$activityTable = $this->getActivityTable();
$customerTable = $this->getCustomerTable();
$select = "SELECT {$table}.*, {$projectTable}.name AS projectName, {$customerTable}.name AS customerName, {$activityTable}.name AS activityName, {$customerTable}.customerID AS customerID\n \t\t\t\tFROM {$table}\n \tJOIN {$projectTable} USING(projectID)\n \tJOIN {$customerTable} USING(customerID)\n \tJOIN {$activityTable} USING(activityID)";
if ($timeEntryID) {
$result = $this->conn->Query("{$select} WHERE timeEntryID = " . $timeEntryID);
} else {
$result = $this->conn->Query("{$select} WHERE userID = " . $this->kga['user']['userID'] . " ORDER BY timeEntryID DESC LIMIT 1");
}
if (!$result) {
$this->logLastError('timeSheet_get_data');
return false;
}
return $this->conn->RowArray(0, MYSQLI_ASSOC);
}