<?php
require_once(__DIR__."/../includes/sysinit.php");
include("team.php");
$_team = new Team; //new class instance
$_team->hddnTeamId			= $_POST['hddnTeamId'];
$_team->edtTeamName			= $_POST['edtTeamName'];
$_team->selVehicleId		= $_POST['selVehicleId'];
$_team->cbTeamActive		= $_POST['cbTeamActive'];
$_team->userList			= json_decode($_POST['userList'], true);
$_team->lstDOW				= json_decode($_POST['lstDOW'], true);

if ($_POST['action']=='0') $_team->addTeam();
if ($_POST['action']=='1') $_team->updateTeam();
if ($_POST['action']=='2') $_team->viewTeam();
if ($_POST['action']=='3') $_team->editTeam();
if ($_POST['action']=='4') $_team->deleteTeam();
unset($_team);
