summaryrefslogtreecommitdiff
path: root/includes/model/ShiftTypes_model.php
diff options
context:
space:
mode:
authorBot <bot@myigel.name>2017-01-02 03:57:23 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-02 03:57:23 +0100
commit7313e15ce8236e19331fb6639a3a5b97c8f06ecd (patch)
tree399e5eaa403d6dd5993ca8fb6f2162319d2ed2e1 /includes/model/ShiftTypes_model.php
parentb839e401062b294292fdcbd7e30b79bc149fab6f (diff)
PSR-2 formatting
Diffstat (limited to 'includes/model/ShiftTypes_model.php')
-rw-r--r--includes/model/ShiftTypes_model.php65
1 files changed, 34 insertions, 31 deletions
diff --git a/includes/model/ShiftTypes_model.php b/includes/model/ShiftTypes_model.php
index 89704a65..fb361db9 100644
--- a/includes/model/ShiftTypes_model.php
+++ b/includes/model/ShiftTypes_model.php
@@ -4,20 +4,22 @@
* Delete a shift type.
* @param int $shifttype_id
*/
-function ShiftType_delete($shifttype_id) {
- return sql_query("DELETE FROM `ShiftTypes` WHERE `id`='" . sql_escape($shifttype_id) . "'");
+function ShiftType_delete($shifttype_id)
+{
+ return sql_query("DELETE FROM `ShiftTypes` WHERE `id`='" . sql_escape($shifttype_id) . "'");
}
/**
* Update a shift type.
*
- * @param int $shifttype_id
- * @param string $name
- * @param int $angeltype_id
- * @param string $description
+ * @param int $shifttype_id
+ * @param string $name
+ * @param int $angeltype_id
+ * @param string $description
*/
-function ShiftType_update($shifttype_id, $name, $angeltype_id, $description) {
- return sql_query("UPDATE `ShiftTypes` SET
+function ShiftType_update($shifttype_id, $name, $angeltype_id, $description)
+{
+ return sql_query("UPDATE `ShiftTypes` SET
`name`='" . sql_escape($name) . "',
`angeltype_id`=" . sql_null($angeltype_id) . ",
`description`='" . sql_escape($description) . "'
@@ -27,43 +29,44 @@ function ShiftType_update($shifttype_id, $name, $angeltype_id, $description) {
/**
* Create a shift type.
*
- * @param string $name
- * @param int $angeltype_id
- * @param string $description
+ * @param string $name
+ * @param int $angeltype_id
+ * @param string $description
* @return new shifttype id
*/
-function ShiftType_create($name, $angeltype_id, $description) {
- $result = sql_query("INSERT INTO `ShiftTypes` SET
+function ShiftType_create($name, $angeltype_id, $description)
+{
+ $result = sql_query("INSERT INTO `ShiftTypes` SET
`name`='" . sql_escape($name) . "',
`angeltype_id`=" . sql_null($angeltype_id) . ",
`description`='" . sql_escape($description) . "'");
- if ($result === false) {
- return false;
- }
- return sql_id();
+ if ($result === false) {
+ return false;
+ }
+ return sql_id();
}
/**
* Get a shift type by id.
*
- * @param int $shifttype_id
+ * @param int $shifttype_id
*/
-function ShiftType($shifttype_id) {
- $shifttype = sql_select("SELECT * FROM `ShiftTypes` WHERE `id`='" . sql_escape($shifttype_id) . "'");
- if ($shifttype === false) {
- engelsystem_error('Unable to load shift type.');
- }
- if ($shifttype == null) {
- return null;
- }
- return $shifttype[0];
+function ShiftType($shifttype_id)
+{
+ $shifttype = sql_select("SELECT * FROM `ShiftTypes` WHERE `id`='" . sql_escape($shifttype_id) . "'");
+ if ($shifttype === false) {
+ engelsystem_error('Unable to load shift type.');
+ }
+ if ($shifttype == null) {
+ return null;
+ }
+ return $shifttype[0];
}
/**
* Get all shift types.
*/
-function ShiftTypes() {
- return sql_select("SELECT * FROM `ShiftTypes` ORDER BY `name`");
+function ShiftTypes()
+{
+ return sql_select("SELECT * FROM `ShiftTypes` ORDER BY `name`");
}
-
-?> \ No newline at end of file