示例#1
0
?>
</head>
<body class="skin-blue">
<?php 
include_once 'lib/nav.inc.php';
include_once 'lib/slidebar_left.inc.php';
if (!empty($_POST)) {
    $node_name = $_POST['node_name'];
    $node_type = $_POST['node_type'];
    $node_server = $_POST['node_server'];
    $node_method = $_POST['node_method'];
    $node_info = $_POST['node_info'];
    $node_status = $_POST['node_status'];
    $node_order = $_POST['node_order'];
    $n = new node(0);
    $query = $n->add($node_name, $node_type, $node_server, $node_method, $node_info, $node_status, $node_order);
    if ($query) {
        echo ' <script>alert("添加成功!")</script> ';
        echo " <script>window.location='node.php';</script> ";
    }
}
?>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            节点列表
            <small>Node List</small>
        </h1>
    </section>
示例#2
0
             $message = $ui[$status];
         }
     } else {
         $message = $ui['accessDenied'];
     }
     break;
 case 'add':
     if (isset($_POST['faction'], $_POST['name'], $_POST['x'], $_POST['y'])) {
         if ($_POST['faction'] != '' && $_POST['name'] != '' && $_POST['x'] != '' && $_POST['y'] != '') {
             $node = new node();
             $node->data['faction'] = $_POST['faction'];
             $node->data['user'] = $_SESSION[$shortTitle . 'User']['id'];
             $node->data['name'] = $_POST['name'];
             $node->location['x'] = $_POST['x'];
             $node->location['y'] = $_POST['y'];
             $message = $ui[$node->add($_SESSION[$shortTitle . 'User']['id'])];
         } else {
             $message = $ui['insufficientData'];
         }
     }
     break;
 case 'remove':
     if (isset($_GET['nodeId'])) {
         $node = new node();
         $status = $node->get('id', $_GET['nodeId']);
         if ($status == 'done') {
             if (isset($_GET['go']) && $_GET['go']) {
                 if ($node->data['user'] == $_SESSION[$shortTitle . 'User']['id']) {
                     $status = node::remove($_GET['nodeId']);
                     if ($status == 'done') {
                         header('location: node.php?action=list');