87 lines
3.5 KiB
PHP
87 lines
3.5 KiB
PHP
|
<?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,"
|
||
|
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers) VALUES("
|
||
|
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?)";
|
||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||
|
$stmt->execute(array("Admin",1,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0));
|
||
|
$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,"
|
||
|
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers) VALUES("
|
||
|
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?)";
|
||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||
|
$stmt->execute(array("Manager",0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1));
|
||
|
$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,"
|
||
|
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers) VALUES("
|
||
|
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?)";
|
||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||
|
$stmt->execute(array("Manager",0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1));
|
||
|
$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,"
|
||
|
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers) VALUES("
|
||
|
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?)";
|
||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||
|
$stmt->execute(array("Kellner",0,1,1,1,1,1,0,1,0,0,1,0,1,0,1,0));
|
||
|
$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,"
|
||
|
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers) VALUES("
|
||
|
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?)";
|
||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||
|
$stmt->execute(array("Kellner",0,1,0,0,0,1,0,1,0,0,1,0,1,0,1,0));
|
||
|
$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,"
|
||
|
. "right_dash,right_reservation,right_rating,right_changeprice,right_customers) VALUES("
|
||
|
. "?,?,?,?,? ,?,?,?,?,?, ?,?,?,?,?, ?,?)";
|
||
|
$stmt = $pdo->prepare(DbUtils::substTableAlias($sql));
|
||
|
$stmt->execute(array("Koch",0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0));
|
||
|
$id = $pdo->lastInsertId();
|
||
|
return $id;
|
||
|
}
|
||
|
}
|