Exemplo n.º 1
0
require_once '../classes/moduleutils.class.php';
$moduleID = check_var('module', 'GET', true, false, true);
$module_details = module_utils::get_full_details_by_ID($moduleID, $mysqli);
if (!$module_details) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
if (!$userObject->has_role(array('SysAdmin', 'Admin'))) {
    if ($module_details['add_team_members'] == 0) {
        $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
        $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
    }
}
if (isset($_POST['submit'])) {
    // Clear the team of all members.
    UserUtils::clear_staff_modules_by_moduleID($moduleID, $mysqli);
    // Insert a record for each team member.
    for ($i = 0; $i < $_POST['staff_no']; $i++) {
        if (isset($_POST["staff{$i}"]) and $_POST["staff{$i}"] != '') {
            UserUtils::add_staff_to_module($_POST["staff{$i}"], $moduleID, $mysqli);
        }
    }
    ?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html;charset=<?php 
    echo $configObject->get('cfg_page_charset');
    ?>
" />
  <title><?php