20161215
This commit is contained in:
@@ -15,7 +15,6 @@ class user {
|
||||
private $user_last_name;
|
||||
private $user_first_name;
|
||||
private $user_password;
|
||||
private $user_helper;
|
||||
private $user_last_login;
|
||||
private $logged_in;
|
||||
private $user_type;
|
||||
@@ -41,10 +40,6 @@ class user {
|
||||
$this->user_password = $_u_pass;
|
||||
}
|
||||
|
||||
public function set_ua_helper($_u_helper) {
|
||||
$this->user_helper = $_u_helper;
|
||||
}
|
||||
|
||||
public function set_ua_last_login($_u_last_login) {
|
||||
$this->user_last_login = $_u_last_login;
|
||||
}
|
||||
@@ -73,10 +68,6 @@ class user {
|
||||
return $this->user_password;
|
||||
}
|
||||
|
||||
public function get_ua_helper() {
|
||||
return $this->user_helper;
|
||||
}
|
||||
|
||||
public function get_ua_deleted() {
|
||||
return $this->user_deleted;
|
||||
}
|
||||
@@ -109,7 +100,14 @@ class user {
|
||||
public function is_coach_at_training($_training_id) {
|
||||
global $sql;
|
||||
//kap egy training id-t, és megmondja, hogy az user be van-e jelölve edzőként azon az edzésen
|
||||
$query = "SELECT * FROM training_coach WHERE trc_coach_uc_id = '" . $this->get_ua_id() . "' AND trc_training_tr_id = '" . $_training_id ."';";
|
||||
$query = "SELECT * FROM training_coach WHERE trc_coach_uc_id = '" . $this->get_ua_id() . "' AND trc_training_tr_id = '" . $_training_id ."' AND trc_helper = 0;";
|
||||
return $sql->num_of_rows($query);
|
||||
}
|
||||
|
||||
public function is_helper_at_training($_training_id) {
|
||||
global $sql;
|
||||
//kap egy training id-t, és megmondja, hogy az user be van-e jelölve segédedzőként azon az edzésen
|
||||
$query = "SELECT * FROM training_coach WHERE trc_coach_uc_id = '" . $this->get_ua_id() . "' AND trc_training_tr_id = '" . $_training_id ."' AND trc_helper = 1;";
|
||||
return $sql->num_of_rows($query);
|
||||
}
|
||||
|
||||
@@ -123,23 +121,21 @@ class user {
|
||||
$this->user_type = $_type;
|
||||
}
|
||||
|
||||
public static function create_user($_name, $_helper, $_password) {
|
||||
public static function create_user($_name, $_password) {
|
||||
global $sql;
|
||||
return $sql->insert_into('user_coach', array(
|
||||
'ua_name' => $_name,
|
||||
'ua_helper' => $_helper,
|
||||
'ua_password' => $_password
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public static function update_user($_name, $_helper, $_password, $_ua_id) {
|
||||
public static function update_user($_name, $_password, $_ua_id) {
|
||||
global $sql;
|
||||
if ($_password != "-1") {
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_helper' => $_helper,
|
||||
'ua_password' => $_password
|
||||
),
|
||||
array(
|
||||
@@ -151,7 +147,6 @@ class user {
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_helper' => $_helper
|
||||
),
|
||||
array(
|
||||
'ua_id' => $_ua_id
|
||||
|
||||
Reference in New Issue
Block a user