Hi
I am currently building a HR database with dadabik. In the HR database every person is registered and gets a person_id.
Now i want to build on top of it an absence database. As the users should only see his absences i use the ID_user form field. "Unfortunate" it looks like it is only possible to save the username with this field and not the id.
As i need to connect the absence with the person_id it came to my mind to use a calculated field to fetch with the username the person_id and add this to the forgein key field.
Code:
I guess i made something wrong as the field isn't filled with something.
Two questions:
- Is there a way to debug and see what the function actually really does?
- What is wrong with my code?
Thanks
---------------
Your current DaDaBIK version
You are using DaDaBIK version 11.7-Elba platinum, installed on 25.10.2022 (installation code: 183606357f1db7e961), the latest version of DaDaBIK is 11.7-Elba released on 18.08.2022
You are running the latest release of DaDaBIK
In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.
System info
PHP Version: 7.4.30
mysql version: 5.7.39
Web server: Apache
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
--------------------
I am currently building a HR database with dadabik. In the HR database every person is registered and gets a person_id.
Now i want to build on top of it an absence database. As the users should only see his absences i use the ID_user form field. "Unfortunate" it looks like it is only possible to save the username with this field and not the id.
As i need to connect the absence with the person_id it came to my mind to use a calculated field to fetch with the username the person_id and add this to the forgein key field.
Code:
PHP:
function dadabik_fill_person_id ($params){
global $conn;
// get the name from the ID
$sql = "SELECT id_user FROM dadabik_absence_users WHERE username_user = :username_user";
$res_prepare = prepare_db($conn, $sql);
$res_bind = bind_param_db($res_prepare, ':username_user', $absence_created_by);
$res = execute_prepared_db($res_prepare,0);
$row = fetch_row_db($res_prepare);
return $row['id_user'];
}
I guess i made something wrong as the field isn't filled with something.
Two questions:
- Is there a way to debug and see what the function actually really does?
- What is wrong with my code?
Thanks
---------------
Your current DaDaBIK version
You are using DaDaBIK version 11.7-Elba platinum, installed on 25.10.2022 (installation code: 183606357f1db7e961), the latest version of DaDaBIK is 11.7-Elba released on 18.08.2022
You are running the latest release of DaDaBIK
In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.
System info
PHP Version: 7.4.30
mysql version: 5.7.39
Web server: Apache
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
--------------------