ordersprinter/webapp/php/utilities/roles.php

87 lines
3.8 KiB
PHP
Raw Normal View History

2020-11-19 23:03:48 +01:00
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of roles
*
* @author stefan
*/
class Roles {
public static function insertAdminRole($pdo) {
$sql = "INSERT INTO %roles% (name,"
. "is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,"
. "right_statistics,right_bill,right_products,right_manager,right_closing,"
2020-11-19 23:11:27 +01:00
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers,right_timetracking,right_timemanager) VALUES("
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?)";
2020-11-19 23:03:48 +01:00
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
2020-11-19 23:11:27 +01:00
$stmt->execute(array("Admin",1,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,1));
2020-11-19 23:03:48 +01:00
$id = $pdo->lastInsertId();
return $id;
}
public static function insertDigiManagerRole($pdo) {
$sql = "INSERT INTO %roles% (name,"
. "is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,"
. "right_statistics,right_bill,right_products,right_manager,right_closing,"
2020-11-19 23:11:27 +01:00
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers,right_timetracking,right_timemanager) VALUES("
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?)";
2020-11-19 23:03:48 +01:00
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
2020-11-19 23:11:27 +01:00
$stmt->execute(array("Manager",0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1));
2020-11-19 23:03:48 +01:00
$id = $pdo->lastInsertId();
return $id;
}
public static function insertWorkManagerRole($pdo) {
$sql = "INSERT INTO %roles% (name,"
. "is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,"
. "right_statistics,right_bill,right_products,right_manager,right_closing,"
2020-11-19 23:11:27 +01:00
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers,right_timetracking,right_timemanager) VALUES("
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?)";
2020-11-19 23:03:48 +01:00
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
2020-11-19 23:11:27 +01:00
$stmt->execute(array("Manager",0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1));
2020-11-19 23:03:48 +01:00
$id = $pdo->lastInsertId();
return $id;
}
public static function insertDigiWaiterRole($pdo) {
$sql = "INSERT INTO %roles% (name,"
. "is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,"
. "right_statistics,right_bill,right_products,right_manager,right_closing,"
2020-11-19 23:11:27 +01:00
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers,right_timetracking,right_timemanager) VALUES("
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?)";
2020-11-19 23:03:48 +01:00
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
2020-11-19 23:11:27 +01:00
$stmt->execute(array("Kellner",0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0,1,0));
2020-11-19 23:03:48 +01:00
$id = $pdo->lastInsertId();
return $id;
}
public static function insertWorkWaiterRole($pdo) {
$sql = "INSERT INTO %roles% (name,"
. "is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,"
. "right_statistics,right_bill,right_products,right_manager,right_closing,"
2020-11-19 23:11:27 +01:00
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers,right_timetracking,right_timemanager) VALUES("
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?)";
2020-11-19 23:03:48 +01:00
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
2020-11-19 23:11:27 +01:00
$stmt->execute(array("Kellner",0,1,0,0,0,1,0,1,0,0,1,0,1,0,1,0,1,0));
2020-11-19 23:03:48 +01:00
$id = $pdo->lastInsertId();
return $id;
}
public static function insertCookRole($pdo) {
$sql = "INSERT INTO %roles% (name,"
. "is_admin,right_waiter,right_kitchen,right_bar,right_supply,right_paydesk,"
. "right_statistics,right_bill,right_products,right_manager,right_closing,"
2020-11-19 23:11:27 +01:00
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers,right_timetracking,right_timemanager) VALUES("
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?,?,?)";
2020-11-19 23:03:48 +01:00
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
2020-11-19 23:11:27 +01:00
$stmt->execute(array("Koch",0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0));
2020-11-19 23:03:48 +01:00
$id = $pdo->lastInsertId();
return $id;
}
}