<?php
include_once "token.php";
include_once "../actions/dbPDO.php";
include_once "msg.php";

$token = new TokenMaster($db,$currentToken);
$msg_class = new MSG($db);
if(isset($_POST['staff'])){
    $id = $_POST['id'];
    $staff = $_POST['staff'];
    if($staff == 2){
      $token->outStaff($id);
    }else{
       $token->inStaff($id); 
    }
}
if(isset($_POST['kind'])){
    $id = $_POST['id'];
    $kind = $_POST['kind'];
    $token->kind($id,$kind); 
    }
if(isset($_POST['dell'])){
        $id = $_POST['dell'];
        $token->del($id); 
        }
        
if(isset($_POST['msg'])){
          $msg = $_POST['msg'];
          $title = $_POST['title'];
          $emps = $_POST['selection'];
          $emps = 3 ;
          
          $msg_class->sendMsg($title,$msg,$emps);
          
          }
?>