From 88ea992f9cd17a4722965430c74d8cb27f18688f Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 19 Nov 2017 13:17:34 +0100 Subject: [PATCH] fix sql queries with bools --- includes/model/AngelType_model.php | 6 +++--- includes/model/UserDriverLicenses_model.php | 24 ++++++++++----------- includes/model/User_model.php | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/includes/model/AngelType_model.php b/includes/model/AngelType_model.php index bc535667..69c4e13f 100644 --- a/includes/model/AngelType_model.php +++ b/includes/model/AngelType_model.php @@ -152,10 +152,10 @@ function AngelType_create($angeltype) ', [ $angeltype['name'], - (bool)$angeltype['restricted'], + (int)$angeltype['restricted'], $angeltype['description'], - (bool)$angeltype['requires_driver_license'], - (bool)$angeltype['no_self_signup'], + (int)$angeltype['requires_driver_license'], + (int)$angeltype['no_self_signup'], $angeltype['contact_user_id'], $angeltype['contact_name'], $angeltype['contact_dect'], diff --git a/includes/model/UserDriverLicenses_model.php b/includes/model/UserDriverLicenses_model.php index 798aa6ab..dc38368b 100644 --- a/includes/model/UserDriverLicenses_model.php +++ b/includes/model/UserDriverLicenses_model.php @@ -75,12 +75,12 @@ function UserDriverLicenses_create($user_driver_license, $user) ', [ $user_driver_license['user_id'], - (bool)$user_driver_license['has_car'], - (bool)$user_driver_license['has_license_car'], - (bool)$user_driver_license['has_license_3_5t_transporter'], - (bool)$user_driver_license['has_license_7_5t_truck'], - (bool)$user_driver_license['has_license_12_5t_truck'], - (bool)$user_driver_license['has_license_forklift'], + (int)$user_driver_license['has_car'], + (int)$user_driver_license['has_license_car'], + (int)$user_driver_license['has_license_3_5t_transporter'], + (int)$user_driver_license['has_license_7_5t_truck'], + (int)$user_driver_license['has_license_12_5t_truck'], + (int)$user_driver_license['has_license_forklift'], ] ); @@ -106,12 +106,12 @@ function UserDriverLicenses_update($user_driver_license) WHERE `user_id`=? ', [ - (bool)$user_driver_license['has_car'], - (bool)$user_driver_license['has_license_car'], - (bool)$user_driver_license['has_license_3_5t_transporter'], - (bool)$user_driver_license['has_license_7_5t_truck'], - (bool)$user_driver_license['has_license_12_5t_truck'], - (bool)$user_driver_license['has_license_forklift'], + (int)$user_driver_license['has_car'], + (int)$user_driver_license['has_license_car'], + (int)$user_driver_license['has_license_3_5t_transporter'], + (int)$user_driver_license['has_license_7_5t_truck'], + (int)$user_driver_license['has_license_12_5t_truck'], + (int)$user_driver_license['has_license_forklift'], $user_driver_license['user_id'], ] ); diff --git a/includes/model/User_model.php b/includes/model/User_model.php index 0ed602e0..26eb42c4 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -60,13 +60,13 @@ function User_update($user) $user['DECT'], $user['Handy'], $user['email'], - (bool)$user['email_shiftinfo'], - (bool)$user['email_by_human_allowed'], + (int)$user['email_shiftinfo'], + (int)$user['email_by_human_allowed'], $user['jabber'], $user['Size'], $user['Gekommen'], $user['Aktiv'], - (bool)$user['force_active'], + (int)$user['force_active'], $user['Tshirt'], $user['color'], $user['Sprache'],