|
|
@ -1,5 +1,10 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Delete all unconfirmed UserAngelTypes for given Angeltype.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param int $angeltype_id
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelTypes_delete_all($angeltype_id) {
|
|
|
|
function UserAngelTypes_delete_all($angeltype_id) {
|
|
|
|
return sql_query("
|
|
|
|
return sql_query("
|
|
|
|
DELETE FROM `UserAngelTypes`
|
|
|
|
DELETE FROM `UserAngelTypes`
|
|
|
@ -7,6 +12,12 @@ function UserAngelTypes_delete_all($angeltype_id) {
|
|
|
|
AND `confirm_user_id` IS NULL");
|
|
|
|
AND `confirm_user_id` IS NULL");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Confirm all unconfirmed UserAngelTypes for given Angeltype.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param int $angeltype_id
|
|
|
|
|
|
|
|
* @param User $confirm_user
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelTypes_confirm_all($angeltype_id, $confirm_user) {
|
|
|
|
function UserAngelTypes_confirm_all($angeltype_id, $confirm_user) {
|
|
|
|
return sql_query("
|
|
|
|
return sql_query("
|
|
|
|
UPDATE `UserAngelTypes`
|
|
|
|
UPDATE `UserAngelTypes`
|
|
|
@ -15,6 +26,12 @@ function UserAngelTypes_confirm_all($angeltype_id, $confirm_user) {
|
|
|
|
AND `confirm_user_id` IS NULL");
|
|
|
|
AND `confirm_user_id` IS NULL");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Confirm an UserAngelType with confirming user.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param int $user_angeltype_id
|
|
|
|
|
|
|
|
* @param User $confirm_user
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelType_confirm($user_angeltype_id, $confirm_user) {
|
|
|
|
function UserAngelType_confirm($user_angeltype_id, $confirm_user) {
|
|
|
|
return sql_query("
|
|
|
|
return sql_query("
|
|
|
|
UPDATE `UserAngelTypes`
|
|
|
|
UPDATE `UserAngelTypes`
|
|
|
@ -23,6 +40,11 @@ function UserAngelType_confirm($user_angeltype_id, $confirm_user) {
|
|
|
|
LIMIT 1");
|
|
|
|
LIMIT 1");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Delete an UserAngelType.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param UserAngelType $user_angeltype
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelType_delete($user_angeltype) {
|
|
|
|
function UserAngelType_delete($user_angeltype) {
|
|
|
|
return sql_query("
|
|
|
|
return sql_query("
|
|
|
|
DELETE FROM `UserAngelTypes`
|
|
|
|
DELETE FROM `UserAngelTypes`
|
|
|
@ -30,6 +52,12 @@ function UserAngelType_delete($user_angeltype) {
|
|
|
|
LIMIT 1");
|
|
|
|
LIMIT 1");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Create an UserAngelType.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param User $user
|
|
|
|
|
|
|
|
* @param Angeltype $angeltype
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelType_create($user, $angeltype) {
|
|
|
|
function UserAngelType_create($user, $angeltype) {
|
|
|
|
$result = sql_query("
|
|
|
|
$result = sql_query("
|
|
|
|
INSERT INTO `UserAngelTypes` SET
|
|
|
|
INSERT INTO `UserAngelTypes` SET
|
|
|
@ -40,6 +68,11 @@ function UserAngelType_create($user, $angeltype) {
|
|
|
|
return sql_id();
|
|
|
|
return sql_id();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Get an UserAngelType by its id.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param int $user_angeltype_id
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelType($user_angeltype_id) {
|
|
|
|
function UserAngelType($user_angeltype_id) {
|
|
|
|
$angeltype = sql_select("
|
|
|
|
$angeltype = sql_select("
|
|
|
|
SELECT *
|
|
|
|
SELECT *
|
|
|
@ -53,6 +86,12 @@ function UserAngelType($user_angeltype_id) {
|
|
|
|
return $angeltype[0];
|
|
|
|
return $angeltype[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Get an UserAngelType by user and angeltype.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param User $user
|
|
|
|
|
|
|
|
* @param Angeltype $angeltype
|
|
|
|
|
|
|
|
*/
|
|
|
|
function UserAngelType_by_User_and_AngelType($user, $angeltype) {
|
|
|
|
function UserAngelType_by_User_and_AngelType($user, $angeltype) {
|
|
|
|
$angeltype = sql_select("
|
|
|
|
$angeltype = sql_select("
|
|
|
|
SELECT *
|
|
|
|
SELECT *
|
|
|
|