Example #1
0
                     header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);
                 } else {
                     $message = $ui[$status];
                 }
             } else {
                 header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);
             }
         }
     } else {
         $message = $ui['featureDisabled'];
     }
     break;
 case 'removeUnit':
     if ($flags['train']) {
         if (isset($_GET['unitId'], $_POST['quantity'])) {
             $status = $node->removeUnit($_GET['unitId'], $_POST['quantity'], $node->modules[$_GET['slotId']]['module']);
             if ($status == 'done') {
                 header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);
             } else {
                 $message = $ui[$status];
             }
         }
     } else {
         $message = $ui['featureDisabled'];
     }
     break;
 case 'cancelUnit':
     if (isset($_GET['trainId'])) {
         $status = $node->cancelUnit($_GET['trainId'], $node->modules[$_GET['slotId']]['module']);
         if ($status == 'done') {
             header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);