main
in package
Class, that handles users
Table of Contents
Properties
- $tusers : tab_users
- $tusersdetails : tab_users_details
- $tusersphoto : tab_users_photo
- $tuserssignatures : tab_users_signatures
- $tuserstenants : tab_users_tenants
Methods
- __construct() : mixed
- __destruct() : mixed
- all() : array<string|int, mixed>|bool
- Retrieves all records from the database, with the option to sort the results.
- delete() : bool
- detailsdelete() : bool
- Deletes records from the database based on a specific value and column.
- detailsget() : array<string|int, mixed>|bool
- Retrieves the details of a user based on a given value and column.
- detailsinsert() : bool
- Inserts user details into the database.
- detailsupdate() : bool
- Updates the details of a user in the database.
- get() : array<string|int, mixed>|bool
- Retrieves data from the users table based on a given value and column.
- getall() : array<string|int, mixed>|bool
- Retrieves all records from the database based on a specific value and column, with the option to specify the column to sort the results.
- getalltechs() : array<string|int, mixed>|bool
- getview() : array<string|int, mixed>|bool
- Retrieves the user details view based on a given value and column.
- insert() : string|bool
- Inserts a new record into the database.
- login() : void
- Authenticates a user and logs them into the system.
- photosdelete() : bool
- Deletes photos from the database based on the specified value and column.
- photosget() : array<string|int, mixed>|bool
- Retrieves a photo record from the database based on a specific value and column.
- photosinsert() : bool
- Inserts a new photo record into the database for the specified user.
- photosupdate() : bool
- Updates the specified photo for a user in the database.
- signaturesdelete() : bool
- Deletes records from the database based on the provided value and column.
- signaturesget() : array<string|int, mixed>|bool
- Retrieves signatures based on the given value and column.
- signaturesinsert() : bool
- Inserts a new signature for a user into the database.
- signaturesupdate() : bool
- Updates the signature for a user in the database.
- tenantsdelete() : bool
- Delete the records from the tenants table based on the given value and column.
- tenantsget() : array<string|int, mixed>|bool
- Retrieves tenants based on the given value and column.
- tenantsgetall() : array<string|int, mixed>|bool
- Retrieves all tenants based on the given value.
- tenantsinsert() : bool
- Inserts a new tenant record into the database for a specific user.
- tenantsupdate() : bool
- Updates a specific record in the tenants table of the database.
- update() : bool
- Updates a record in the database with the specified column, value, and user ID.
Properties
$tusers
protected
tab_users
$tusers
$tusersdetails
protected
tab_users_details
$tusersdetails
$tusersphoto
protected
tab_users_photo
$tusersphoto
$tuserssignatures
protected
tab_users_signatures
$tuserssignatures
$tuserstenants
protected
tab_users_tenants
$tuserstenants
Methods
__construct()
public
__construct() : mixed
__destruct()
public
__destruct() : mixed
all()
Retrieves all records from the database, with the option to sort the results.
public
all([string $sort = 'id' ]) : array<string|int, mixed>|bool
Parameters
- $sort : string = 'id'
-
(optional) The field to sort the results by. Defaults to 'id'.
Return values
array<string|int, mixed>|bool —An array of records from the database, sorted by the specified field if provided. Returns false if there was an error retrieving the records.
delete()
public
delete(string $val[, string $col = 'id' ]) : bool
Parameters
- $val : string
- $col : string = 'id'
Return values
booldetailsdelete()
Deletes records from the database based on a specific value and column.
public
detailsdelete(string $val[, string $col = 'uid' ]) : bool
Parameters
- $val : string
-
The value to match for deletion.
- $col : string = 'uid'
-
(optional) The column to search for the value. Defaults to 'uid'.
Return values
bool —True if the deletion was successful, false otherwise.
detailsget()
Retrieves the details of a user based on a given value and column.
public
detailsget(string $val[, string $col = 'uid' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to search for.
- $col : string = 'uid'
-
The column to search in (defaults to 'uid').
Return values
array<string|int, mixed>|bool —Returns an array containing the user details if found, otherwise returns false.
detailsinsert()
Inserts user details into the database.
public
detailsinsert(string $uid, string $first, string $last, string $sal, string $mail, string $phone, string $mobile, string $direct[, string $sl = '' ]) : bool
Parameters
- $uid : string
-
The user ID.
- $first : string
-
The first name of the user.
- $last : string
-
The last name of the user.
- $sal : string
-
The Salutation of the user.
- $mail : string
-
The email of the user.
- $phone : string
-
The phone number of the user.
- $mobile : string
-
The mobile number of the user.
- $direct : string
-
The direct contact number of the user.
- $sl : string = ''
-
The social security number of the user.
Return values
bool —Returns true if the user details were successfully inserted into the database, false otherwise.
detailsupdate()
Updates the details of a user in the database.
public
detailsupdate(string $col, string $val, string $uid) : bool
Parameters
- $col : string
-
The column name in the details table to update.
- $val : string
-
The new value for the specified column.
- $uid : string
-
The unique identifier of the user to update the details for.
Return values
bool —Returns true if the update was successful, false otherwise.
get()
Retrieves data from the users table based on a given value and column.
public
get(string $val[, string $col = 'id' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to search for.
- $col : string = 'id'
-
The column to search in (defaults to 'id').
Return values
array<string|int, mixed>|bool —Returns an array containing the user data if found, otherwise returns false.
getall()
Retrieves all records from the database based on a specific value and column, with the option to specify the column to sort the results.
public
getall(string $val[, string $col = 'group' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to search for in the specified column.
- $col : string = 'group'
-
(optional) The column to search for the specified value. Defaults to 'group'.
Return values
array<string|int, mixed>|bool —An array of records from the database that match the specified value and column, sorted by the specified column if provided. Returns false if there was an error retrieving the records.
getalltechs()
public
getalltechs() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|boolgetview()
Retrieves the user details view based on a given value and column.
public
getview(string $val[, string $col = 'id' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to search for.
- $col : string = 'id'
-
The column to search in (defaults to 'id').
Return values
array<string|int, mixed>|bool —Returns an array containing the user details view if found, otherwise returns false.
insert()
Inserts a new record into the database.
public
insert(string $sid, string $username, string $pass[, string $group = '1' ][, string $status = '0' ]) : string|bool
Parameters
- $sid : string
-
The unique identifier for the record.
- $username : string
-
The username for the new record.
- $pass : string
-
The password for the new record.
- $group : string = '1'
-
(optional) The group ID for the new record. Defaults to '1'.
- $status : string = '0'
-
(optional) The status for the new record. Defaults to '0'.
Return values
string|bool —Returns the inserted record's ID if successful, otherwise returns false if there was an error inserting the record.
login()
Authenticates a user and logs them into the system.
public
login(string $user, string $pass) : void
Parameters
- $user : string
-
The username of the user to log in.
- $pass : string
-
The password of the user to log in.
photosdelete()
Deletes photos from the database based on the specified value and column.
public
photosdelete(string $val[, string $col = 'uid' ]) : bool
Parameters
- $val : string
-
The value to match against in the specified column.
- $col : string = 'uid'
-
(optional) The column to search for the specified value. Defaults to 'uid'.
Return values
bool —Returns true if the photos were successfully deleted from the database. Returns false if there was an error deleting the photos.
photosget()
Retrieves a photo record from the database based on a specific value and column.
public
photosget(string $val[, string $col = 'uid' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
The value to search for in the specified column.
- $col : string = 'uid'
-
(optional) The column to search for the value in. Defaults to 'uid'.
Return values
array<string|int, mixed>|bool —An array representing the photo record from the database matching the specified value and column. Returns false if there was an error retrieving the record or if no record matches the specified criteria.
photosinsert()
Inserts a new photo record into the database for the specified user.
public
photosinsert(string $uid, string $photo) : bool
Parameters
- $uid : string
-
The unique identifier of the user.
- $photo : string
-
The photo to be inserted.
Return values
bool —True if the photo was successfully inserted into the database, false otherwise.
photosupdate()
Updates the specified photo for a user in the database.
public
photosupdate(string $photo, string $uid) : bool
Parameters
- $photo : string
-
The new photo to be updated for the user.
- $uid : string
-
The unique identifier of the user.
Return values
bool —Returns true if the photo update was successful. Returns false otherwise.
signaturesdelete()
Deletes records from the database based on the provided value and column.
public
signaturesdelete(string $val[, string $col = 'uid' ]) : bool
Parameters
- $val : string
-
The value to match for deletion.
- $col : string = 'uid'
-
(optional) The column to use for matching. Defaults to 'uid'.
Return values
bool —True if the deletion was successful, false otherwise.
signaturesget()
Retrieves signatures based on the given value and column.
public
signaturesget(string $val[, string $col = 'uid' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
- The value used to retrieve the signatures.
- $col : string = 'uid'
-
- (optional) The column to search in. Default is 'uid'.
Return values
array<string|int, mixed>|bool —- An array containing the retrieved signatures or a boolean value indicating if the retrieval was successful or not.
signaturesinsert()
Inserts a new signature for a user into the database.
public
signaturesinsert(string $uid, string $sign) : bool
Parameters
- $uid : string
-
The user ID associated with the signature.
- $sign : string
-
The signature to be inserted.
Return values
bool —Returns true if the signature was successfully inserted into the database. Returns false if there was an error inserting the signature.
signaturesupdate()
Updates the signature for a user in the database.
public
signaturesupdate(string $uid, string $sign) : bool
Parameters
- $uid : string
-
The unique identifier of the user.
- $sign : string
-
The new signature for the user.
Return values
bool —Returns true if the signature was successfully updated in the database, false otherwise.
tenantsdelete()
Delete the records from the tenants table based on the given value and column.
public
tenantsdelete(string $val[, string $col = 'uid' ]) : bool
Parameters
- $val : string
-
The value to match against the specified column for deleting records.
- $col : string = 'uid'
-
(optional) The column to match the value against. Defaults to 'uid'.
Return values
bool —Returns true if the deletion was successful. Returns false if there was an error deleting the records.
tenantsget()
Retrieves tenants based on the given value and column.
public
tenantsget(string $val[, string $col = 'uid' ]) : array<string|int, mixed>|bool
Parameters
- $val : string
-
- The value used to retrieve the tenants.
- $col : string = 'uid'
-
- (Optional) The column used for the retrieval. Defaults to 'uid'.
Return values
array<string|int, mixed>|bool —- An array containing the tenants that match the given value and column, or a boolean value indicating if the retrieval was successful or not.
tenantsgetall()
Retrieves all tenants based on the given value.
public
tenantsgetall(string $uid) : array<string|int, mixed>|bool
Parameters
- $uid : string
-
- The value used to retrieve the tenants.
Return values
array<string|int, mixed>|bool —- An array containing all tenants or a boolean value indicating if the retrieval was successful or not.
tenantsinsert()
Inserts a new tenant record into the database for a specific user.
public
tenantsinsert(string $uid, string $tenant[, string $access = '0' ]) : bool
Parameters
- $uid : string
-
The user ID to associate the new tenant record with.
- $tenant : string
-
The name of the tenant.
- $access : string = '0'
-
(optional) The access level for the tenant. Defaults to '0'.
Return values
bool —Returns true if the tenant record was successfully inserted into the database. Returns false if there was an error inserting the record.
tenantsupdate()
Updates a specific record in the tenants table of the database.
public
tenantsupdate(string $col, string $val, string $uid) : bool
Parameters
- $col : string
-
The column name of the field to update.
- $val : string
-
The new value to set for the specified field.
- $uid : string
-
The unique identifier of the record to update.
Return values
bool —Returns true if the record was updated successfully, false otherwise.
update()
Updates a record in the database with the specified column, value, and user ID.
public
update(string $col, string $val, string $uid) : bool
Parameters
- $col : string
-
The column to update.
- $val : string
-
The new value for the specified column.
- $uid : string
-
The user ID of the record to update.
Return values
bool —Returns true if the record was successfully updated, and false otherwise.