created coach site
This commit is contained in:
@@ -16,6 +16,7 @@ class user {
|
||||
private $user_first_name;
|
||||
private $user_password;
|
||||
private $user_last_login;
|
||||
private $user_admin;
|
||||
private $logged_in;
|
||||
private $user_type;
|
||||
private $user_deleted;
|
||||
@@ -44,6 +45,10 @@ class user {
|
||||
$this->user_last_login = $_u_last_login;
|
||||
}
|
||||
|
||||
public function set_ua_admin($_u_admin) {
|
||||
$this->user_admin = $_u_admin;
|
||||
}
|
||||
|
||||
public function set_ua_deleted($_u_deleted) {
|
||||
$this->user_deleted = $_u_deleted;
|
||||
}
|
||||
@@ -68,6 +73,10 @@ class user {
|
||||
return $this->user_password;
|
||||
}
|
||||
|
||||
public function get_ua_admin() {
|
||||
return $this->user_admin;
|
||||
}
|
||||
|
||||
public function get_ua_deleted() {
|
||||
return $this->user_deleted;
|
||||
}
|
||||
@@ -121,6 +130,11 @@ class user {
|
||||
$this->user_type = $_type;
|
||||
}
|
||||
|
||||
public function get_training_count_in_month($_year, $_month) {
|
||||
global $sql;
|
||||
return $sql->single_variable('select count(distinct trc_id) from training_coach join training on tr_id = trc_training_tr_id where year(tr_date) = '.$_year.' and month(tr_date) = '.$_month.' and trc_coach_uc_id = '.$this->get_ua_id().';');
|
||||
}
|
||||
|
||||
public static function create_user($_name, $_password) {
|
||||
global $sql;
|
||||
return $sql->insert_into('user_coach', array(
|
||||
@@ -130,12 +144,13 @@ class user {
|
||||
);
|
||||
}
|
||||
|
||||
public static function update_user($_name, $_password, $_ua_id) {
|
||||
public static function update_user($_name, $_password, $_admin, $_ua_id) {
|
||||
global $sql;
|
||||
if ($_password != "-1") {
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_admin' => ($_admin?1:0),
|
||||
'ua_password' => $_password
|
||||
),
|
||||
array(
|
||||
@@ -147,6 +162,7 @@ class user {
|
||||
return $sql->update_table('user_coach',
|
||||
array(
|
||||
'ua_name' => $_name,
|
||||
'ua_admin' => ($_admin?1:0),
|
||||
),
|
||||
array(
|
||||
'ua_id' => $_ua_id
|
||||
|
||||
Reference in New Issue
Block a user