-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functions to save workouts, added new methods to DBHelper for d…
…ifferent queries, renamed RegistrationService to UserService
- Loading branch information
Showing
10 changed files
with
528 additions
and
61 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
|
||
include "../core/bootstrap.php"; | ||
|
||
class UserRecordsDAO { | ||
|
||
protected $db; | ||
private static $fields = array( | ||
"highestBoulderProject", | ||
"highestBoulderRedpoint", | ||
"highestBoulderFlash", | ||
"highestBoulderOnsight", | ||
"highestTRProject", | ||
"highestTRRedpoint", | ||
"highestTRFlash", | ||
"highestTROnsight", | ||
"highestLeadProject", | ||
"highestLeadRedpoint", | ||
"highestLeadFlash", | ||
"highestLeadOnsight" | ||
); | ||
private static $USERRECORDS_TABLENAME="userrecords"; | ||
|
||
public function __construct() { | ||
$DBManager = new DBConnectionManager(); | ||
$this->db = $DBManager->connect(); | ||
|
||
} | ||
|
||
public function getUserRecords($userid) { | ||
$selectKeyValue = ["userid", $userid]; | ||
return DBHelper::performSimpleSelectQuery($this->db, | ||
self::$USERRECORDS_TABLENAME, $selectKeyValue); | ||
} | ||
|
||
public function createUserRecords($userid, $user_records) { | ||
return DBHelper::performInsertQuery($this->db, | ||
self::$USERRECORDS_TABLENAME, $user_records); | ||
} | ||
|
||
public function updateUserRecords($userid, $user_records) { | ||
$selectValueKey = ["userid", $userid]; | ||
return DBHelper::performUpdateQuery($this->db, | ||
self::$USERRECORDS_TABLENAME, $user_records, $selectValueKey); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.