person; $_roles= $_person['role_ids']; //print_r( $_person ); // if add is set, diplay add sliver form if( $_GET['add'] ) { $node_id= $_GET['add']; $slice_id= $_GET['slice']; // slice info $slice_info= $api->GetSlices( array( intval( $slice_id ) ), array( "name" ) ); // node info $node_info= $api->GetNodes( array( intval( $node_id ) ), array( "hostname" ) ); // get tag types $type_info= $api->GetTagTypes( NULL, array( "tag_type_id", "tagname" ) ); // get the slivers for this node $sliver_info= $api->GetSliceTags( array( "node_id"=>intval( $node_id ), "slice_id"=>intval( $slice_id ) ), array( "tag_type_id", "name" ) ); $types_left= $type_info; // start form echo "
\n

Add a Sliver Tag to ". $slice_info[0]['name'] ." on node ". $node_info[0]['hostname'] ."

\n \n \n \n
Tag:
Value:
\n

\n"; echo "

Back to Node\n

\n"; } // if slice and node ids are passed display slivers and tags if( $_GET['slice'] && $_GET['node'] ) { $slice_id= $_GET['slice']; $node_id= $_GET['node']; // slice info $slice_info= $api->GetSlices( array( intval( $slice_id ) ), array( "name" ) ); // node info $node_info= $api->GetNodes( array( intval( $node_id ) ), array( "hostname" ) ); // get the slivers for this node $sliver_info= $api->GetSliceTags( array( "node_id"=>intval( $node_id ), "slice_id"=>intval( $slice_id ) ), array( "slice_tag_id", "name", "value", "min_role_id", "description" ) ); // get the attrbibutes for this slice $tag_info= $api->GetSliceTags( array( intval( $slice_id ) ), array( "slice_tag_id", "name", "value", "min_role_id", "description" ) ); // start form echo "
\n

Sliver Details for slice ". $slice_info[0]['name'] ." on node ". $node_info[0]['hostname'] ."

\n"; // sliver tags of slice if( empty( $sliver_info ) ) // if no sliver exists tell user echo "No sliver tag for this node/slice sliver combination.\n"; else { echo "

\n\n"; if ( in_array( 10, $_roles ) || ( in_array( 20, $_roles ) && in_array( $node_info, $_person['site_ids'] ) ) ) echo ""; echo "\n"; foreach( $sliver_info AS $sliver ) { echo ""; if ( in_array( 10, $_roles ) || ( in_array( 20, $_roles ) && in_array( $node_info, $_person['site_ids'] ) ) ) echo ""; echo "\n"; } echo "
Slivers
NameValueMin RollDescription
". $sliver['name'] ."". $sliver['value'] ."". $sliver['min_role_id'] ."". $sliver['description'] ."EditRemove
\n"; } if ( in_array( 10, $_roles ) || ( in_array( 20, $_roles ) && in_array( $node_info, $_person['site_ids'] ) ) ) echo "

Add Sliver Tag\n"; echo "


"; // regular tags of slice if( empty( $tag_info ) ) // if no tags exist tell user echo "No Tags for this slice.\n"; else { echo "

\n\n"; if ( in_array( 10, $_roles ) || ( in_array( 20, $_roles ) && in_array( $node_info, $_person['site_ids'] ) ) ) echo ""; echo "\n"; foreach( $tag_info AS $tag ) { echo ""; if ( in_array( 10, $_roles ) || ( in_array( 20, $_roles ) && in_array( $node_info, $_person['site_ids'] ) ) ) echo ""; echo "\n"; } echo "
Tags
NameValueMin RollDescription
". $tag['name'] ."". $tag['value'] ."". $tag['min_role_id'] ."". $tag['description'] ."Edit
\n"; } echo "

Back to Node\n

\n"; } // Print footer include 'plc_footer.php'; ?>