showstuff.php3 23.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<?php
#
# This is an included file. No headers or footers.
#
# Functions to dump out various things.  
#

#
# A project
#
function SHOWPROJECT($pid, $thisuid) {
    global $TBDBNAME;

    $query_result = mysql_db_query($TBDBNAME,
	"SELECT * FROM projects WHERE pid=\"$pid\"");
    if (mysql_num_rows($query_result) == 0) {
       USERERROR("The project $pid is not a valid project.", 1);
    }
    $row = mysql_fetch_array($query_result);

    echo "<table align=center border=1>\n";

    $proj_created	= $row[created];
    $proj_expires	= $row[expires];
    $proj_name		= $row[name];
    $proj_URL		= $row[URL];
27
    $proj_public        = $row[public];
28
    $proj_funders	= $row[funders];
29 30 31 32 33 34
    $proj_head_uid	= $row[head_uid];
    $proj_members       = $row[num_members];
    $proj_pcs           = $row[num_pcs];
    $proj_sharks        = $row[num_sharks];
    $proj_why           = $row[why];
    $control_node	= $row[control_node];
35
    $approved           = $row[approved];
36 37
    $expt_count         = $row[expt_count];
    $expt_last          = $row[expt_last];
38

39 40 41 42 43 44 45
    if ($proj_public) {
	$proj_public = "Yes";
    }
    else {
	$proj_public = "No";
    }

46 47 48 49
    if (!$expt_last) {
	$expt_last = "&nbsp";
    }

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
    #
    # Generate the table.
    # 
    echo "<tr>
              <td>Name: </td>
              <td class=\"left\">$pid</td>
          </tr>\n";
    
    echo "<tr>
              <td>Long Name: </td>
              <td class=\"left\">$proj_name</td>
          </tr>\n";
    
    echo "<tr>
              <td>Project Head: </td>
              <td class=\"left\">
66
                <A href='showuser.php3?target_uid=$proj_head_uid'>
67 68 69 70 71 72 73 74 75
                     $proj_head_uid</A></td>
          </tr>\n";
    
    echo "<tr>
              <td>URL: </td>
              <td class=\"left\">
                  <A href='$proj_URL'>$proj_URL</A></td>
          </tr>\n";
    
76 77 78 79 80
    echo "<tr>
              <td>Publicly Visible: </td>
              <td class=\"left\">$proj_public</td>
          </tr>\n";
    
81 82 83 84 85
    echo "<tr>
              <td>Funders: </td>
              <td class=\"left\">$proj_funders</td>
          </tr>\n";

86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    echo "<tr>
              <td>#Project Members: </td>
              <td class=\"left\">$proj_members</td>
          </tr>\n";
    
    echo "<tr>
              <td>#PCs: </td>
              <td class=\"left\">$proj_pcs</td>
          </tr>\n";
    
    echo "<tr>
              <td>#Sharks: </td>
              <td class=\"left\">$proj_sharks</td>
          </tr>\n";
    
    echo "<tr>
              <td>Created: </td>
              <td class=\"left\">$proj_created</td>
          </tr>\n";
    
    echo "<tr>
              <td>Expires: </td>
              <td class=\"left\">$proj_expires</td>
          </tr>\n";
    
111 112 113 114 115 116 117 118 119 120
    echo "<tr>
              <td>Experiments Created:</td>
              <td class=\"left\">$expt_count</td>
          </tr>\n";
    
    echo "<tr>
              <td>Date of last experiment:</td>
              <td class=\"left\">$expt_last</td>
          </tr>\n";
    
121 122 123 124 125 126 127 128 129 130
    echo "<tr>
              <td>Approved?: </td>\n";
    if ($approved) {
	echo "<td class=left><img alt=\"Y\" src=\"greenball.gif\"></td>\n";
    }
    else {
	echo "<td class=left><img alt=\"N\" src=\"redball.gif\"></td>\n";
    }
    echo "</tr>\n";

131
    echo "<tr>
132
              <td colspan='2'>Why?:</td>
133 134 135 136 137 138 139 140 141
          </tr>\n";
    
    echo "<tr>
              <td colspan='2' width=600>$proj_why</td>
          </tr>\n";
    
    echo "</table>\n";
}

Leigh B. Stoller's avatar
Leigh B. Stoller committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
#
# A Group
#
function SHOWGROUP($pid, $gid) {
    $query_result =
	DBQueryFatal("SELECT * FROM groups WHERE pid='$pid' and gid='$gid'");
    $row = mysql_fetch_array($query_result);

    echo "<table align=center border=1>\n";

    $leader	= $row[leader];
    $created	= $row[created];
    $description= $row[description];
    $expt_count = $row[expt_count];
    $expt_last  = $row[expt_last];
    $unix_gid   = $row[unix_gid];
    $unix_name  = $row[unix_name];

    if (!$expt_last) {
	$expt_last = "&nbsp";
    }

    #
    # Generate the table.
    # 
    echo "<tr>
              <td>GID: </td>
              <td class=\"left\">$gid</td>
          </tr>\n";
    
    echo "<tr>
              <td>PID: </td>
              <td class=\"left\">$pid</td>
          </tr>\n";
    
    echo "<tr>
              <td>Description: </td>
              <td class=\"left\">$description</td>
          </tr>\n";
    
    echo "<tr>
              <td>Unix GID: </td>
              <td class=\"left\">$unix_gid</td>
          </tr>\n";
    
    echo "<tr>
              <td>Unix Group Name: </td>
              <td class=\"left\">$unix_name</td>
          </tr>\n";
    
    echo "<tr>
              <td>Group Leader: </td>
              <td class=\"left\">
                <A href='showuser.php3?target_uid=$leader'>$leader</A></td>
          </tr>\n";
    
    echo "<tr>
              <td>Created: </td>
              <td class=\"left\">$created</td>
          </tr>\n";
    
    echo "<tr>
              <td>Experiments Created:</td>
              <td class=\"left\">$expt_count</td>
          </tr>\n";
    
    echo "<tr>
              <td>Date of last experiment:</td>
              <td class=\"left\">$expt_last</td>
          </tr>\n";
    
    echo "</table>\n";
}

#
# A list of Group members.
#
function SHOWGROUPMEMBERS($pid, $gid) {
    $query_result =
	DBQueryFatal("SELECT m.*,u.* FROM group_membership as m ".
		     "left join users as u on u.uid=m.uid ".
		     "WHERE pid='$pid' and gid='$gid'");
    
    if (! mysql_num_rows($query_result)) {
	return;
    }

    echo "<center>
          <h3>Group Members</h3>
          </center>
          <table align=center border=1>\n";

    echo "<tr>
              <td align=center>Name</td>
              <td align=center>UID</td>
              <td align=center>Privs</td>
              <td align=center>Approved?</td>
          </tr>\n";

    while ($row = mysql_fetch_array($query_result)) {
        $target_uid = $row[uid];
	$usr_name   = $row[usr_name];
	$status     = $row[status];
	$trust      = $row[trust];

        echo "<tr>
                  <td>$usr_name</td>
                  <td>
                    <A href='showuser.php3?target_uid=$target_uid'>
                       $target_uid</A>
                  </td>
                  <td>$trust</td>\n";
	    
	if (strcmp($status, "active") == 0 ||
	    strcmp($status, "unverified") == 0) {
	    echo "<td align=center>
                      <img alt=\"Y\" src=\"greenball.gif\"></td>\n";
	}
	else {
	    echo "<td align=center>
                      <img alt=\"N\" src=\"redball.gif\"></td>\n";
	}
	echo "</tr>\n";
    }
    echo "</table>\n";
}

269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
#
# A User
#
function SHOWUSER($uid) {
    global $TBDBNAME;
		
    $userinfo_result = mysql_db_query($TBDBNAME,
	"SELECT * from users where uid=\"$uid\"");

    $row	= mysql_fetch_array($userinfo_result);
    $usr_expires = $row[usr_expires];
    $usr_email   = $row[usr_email];
    $usr_URL     = $row[usr_URL];
    $usr_addr    = $row[usr_addr];
    $usr_name    = $row[usr_name];
    $usr_phone   = $row[usr_phone];
    $usr_passwd  = $row[usr_pswd];
    $usr_title   = $row[usr_title];
    $usr_affil   = $row[usr_affil];
288
    $status      = $row[status];
289 290 291 292 293 294 295 296

    #
    # Last Login info.
    #
    if (($lastweblogin = LASTWEBLOGIN($uid)) == 0)
	$lastweblogin = "&nbsp";
    if (($lastuserslogin = LASTUSERSLOGIN($uid)) == 0)
	$lastuserslogin = "&nbsp";
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
    
    echo "<table align=center border=1>\n";
    
    echo "<tr>
              <td>Username:</td>
              <td>$uid</td>
          </tr>\n";
    
    echo "<tr>
              <td>Full Name:</td>
              <td>$usr_name</td>
          </tr>\n";
    
    echo "<tr>
              <td>Email Address:</td>
              <td>$usr_email</td>
          </tr>\n";
    
    echo "<tr>
              <td>Home Page URL:</td>
              <td><A href='$usr_URL'>$usr_URL</A></td>
          </tr>\n";
    
    echo "<tr>
              <td>Expiration date:</td>
              <td>$usr_expires</td>
          </tr>\n";
    
    echo "<tr>
              <td>Mailing Address:</td>
              <td>$usr_addr</td>
          </tr>\n";
    
    echo "<tr>
              <td>Phone #:</td>
              <td>$usr_phone</td>
          </tr>\n";
    
    echo "<tr>
              <td>Title/Position:</td>
              <td>$usr_title</td>
         </tr>\n";
    
    echo "<tr>
              <td>Institutional Affiliation:</td>
              <td>$usr_affil</td>
          </tr>\n";
    
345 346 347 348 349
    echo "<tr>
              <td>Status:</td>
              <td>$status</td>
          </tr>\n";
    
350 351 352 353 354 355 356 357 358 359
    echo "<tr>
              <td>Last Web Login:</td>
              <td>$lastweblogin</td>
          </tr>\n";
    
    echo "<tr>
              <td>Last Users Login:</td>
              <td>$lastuserslogin</td>
          </tr>\n";
    
360 361 362 363
    echo "</table>\n";

}

364 365 366 367 368 369
#
# Show an experiment.
#
function SHOWEXP($pid, $eid) {
    global $TBDBNAME;
		
Leigh B. Stoller's avatar
Leigh B. Stoller committed
370 371 372 373 374 375
    $query_result =
	DBQueryFatal("SELECT * FROM experiments WHERE ".
		     "eid='$eid' and pid='$pid'");
    if (($exprow = mysql_fetch_array($query_result)) == 0) {
	TBERROR("Experiment $eid in project $pid is gone!\n", 1);
    }
376

Leigh B. Stoller's avatar
Leigh B. Stoller committed
377
    $exp_gid     = $exprow[gid];
378 379 380 381 382 383 384
    $exp_expires = $exprow[expt_expires];
    $exp_name    = $exprow[expt_name];
    $exp_created = $exprow[expt_created];
    $exp_start   = $exprow[expt_start];
    $exp_end     = $exprow[expt_end];
    $exp_created = $exprow[expt_created];
    $exp_head    = $exprow[expt_head_uid];
Leigh B. Stoller's avatar
Leigh B. Stoller committed
385
    $exp_status  = $exprow[state];
386
    $exp_shared  = $exprow[shared];
387 388 389 390
    $exp_path    = $exprow[path];
    $batchmode   = $exprow[batchmode];
    $attempts    = $exprow[attempts];
    $batchstate  = $exprow[batchstate];
391 392 393 394 395 396 397 398

    #
    # Generate the table.
    #
    echo "<table align=center border=1>\n";

    echo "<tr>
            <td>Name: </td>
399
            <td class=\"left\">
Leigh B. Stoller's avatar
Leigh B. Stoller committed
400
                <A href='shownsfile.php3?pid=$pid&eid=$eid'>
401
                   $eid</a></td>
402 403 404 405 406 407 408 409 410 411 412 413
          </tr>\n";

    echo "<tr>
            <td>Long Name: </td>
            <td class=\"left\">$exp_name</td>
          </tr>\n";

    echo "<tr>
            <td>Project: </td>
            <td class=\"left\">$pid</td>
          </tr>\n";

Leigh B. Stoller's avatar
Leigh B. Stoller committed
414 415 416 417 418 419
    echo "<tr>
            <td>Group: </td>
            <td class=\"left\">
                <A href='showgroup.php3?pid=$pid&gid=$exp_gid'>$exp_gid</td>
          </tr>\n";

420 421 422 423 424 425 426 427 428 429 430 431 432
    echo "<tr>
            <td>Experiment Head: </td>
            <td class=\"left\">
                <A href='showuser.php3?target_uid=$exp_head'>
                   $exp_head</td>
          </tr>\n";

    echo "<tr>
            <td>Created: </td>
            <td class=\"left\">$exp_created</td>
          </tr>\n";

    echo "<tr>
433 434
            <td>Expires: </td>
            <td class=\"left\">$exp_expires</td>
435 436 437
          </tr>\n";

    echo "<tr>
438 439
            <td>Started: </td>
            <td class=\"left\">$exp_start</td>
440 441
          </tr>\n";

442 443 444 445 446 447 448 449 450 451 452 453
    echo "<tr>
            <td>Shared: </td>
            <td class=\"left\">";
    if ($exp_shared) {
	echo "<A href='expaccess_form.php3?pid=$pid&eid=$eid'>Yes</a>";
    }
    else {
	echo "No";
    }
    echo "   </td>
          </tr>\n";

454 455 456 457 458
    echo "<tr>
            <td>Status: </td>
            <td class=\"left\">$exp_status</td>
          </tr>\n";

459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
    if ($batchmode) {
	    echo "<tr>
                    <td>Batch Mode: </td>
                    <td class=\"left\">Yes</td>
                  </tr>\n";

	    echo "<tr>
                    <td>Batch Status: </td>
                    <td class=\"left\">$batchstate</td>
                  </tr>\n";

	    echo "<tr>
                    <td>Start Attempts: </td>
                    <td class=\"left\">$attempts</td>
                  </tr>\n";
    }

476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
    echo "</table>\n";
}

#
# Show Node information for an experiment.
#
function SHOWNODES($pid, $eid) {
    global $TBDBNAME;
		
    $reserved_result = mysql_db_query($TBDBNAME,
		"SELECT * FROM reserved WHERE ".
		"eid=\"$eid\" and pid=\"$pid\"");
    
    if (mysql_num_rows($reserved_result)) {
	echo "<center>
              <h3>Reserved Nodes</h3>
              </center>
              <table align=center border=1>
              <tr>
                <td align=center>Node ID</td>
                <td align=center>Node Name</td>
                <td align=center>Type</td>
498
                <td align=center>Default<br>OSID</td>
499 500
                <td align=center>Default<br>Path</td>
                <td align=center>Default<br>Cmdline</td>
501
                <td align=center>Boot<br>Status[1]</td>
502
                <td align=center>Startup<br>Command</td>
503 504
                <td align=center>Startup<br>Status[2]</td>
                <td align=center>Ready<br>Status[3]</td>
505 506 507 508 509 510 511
              </tr>\n";
	
	$query_result = mysql_db_query($TBDBNAME,
		"SELECT nodes.*,reserved.vname ".
	        "FROM nodes LEFT JOIN reserved ".
	        "ON nodes.node_id=reserved.node_id ".
	        "WHERE reserved.eid=\"$eid\" and reserved.pid=\"$pid\" ".
512
	        "ORDER BY type,priority");
513 514 515 516 517

	while ($row = mysql_fetch_array($query_result)) {
	    $node_id = $row[node_id];
	    $vname   = $row[vname];
	    $type    = $row[type];
518
	    $def_boot_osid      = $row[def_boot_osid];
519 520 521 522 523 524
	    $def_boot_path      = $row[def_boot_path];
	    $def_boot_cmd_line  = $row[def_boot_cmd_line];
	    $next_boot_path     = $row[next_boot_path];
	    $next_boot_cmd_line = $row[next_boot_cmd_line];
	    $startupcmd         = $row[startupcmd];
	    $startstatus        = $row[startstatus];
525
	    $readystatus        = $row[ready];
526
	    $bootstatus         = $row[bootstatus];
527 528 529 530 531 532 533 534 535 536 537 538 539

	    if (!$def_boot_cmd_line)
		$def_boot_cmd_line = "NULL";
	    if (!$def_boot_path)
		$def_boot_path = "NULL";
	    if (!$next_boot_path)
		$next_boot_path = "NULL";
	    if (!$next_boot_cmd_line)
		$next_boot_cmd_line = "NULL";
	    if (!$startupcmd)
		$startupcmd = "NULL";
	    if (!$vname)
		$vname = "--";
540 541 542 543
	    if ($readystatus)
		$readylabel = "Yes";
	    else
		$readylabel = "No";
544 545

	    echo "<tr>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
546 547
                    <td><A href='shownode.php3?node_id=$node_id'>$node_id</a>
                        </td>
548
                    <td>$vname</td>
549 550 551 552 553 554 555
                    <td>$type</td>\n";
	    if ($def_boot_osid)
		echo "<td><A href='showosinfo.php3?osid=$def_boot_osid'>
                             $def_boot_osid</A></td>\n";
	    else
		echo "<td>&nbsp</td>\n";
	    
556
	    echo "  <td>$def_boot_path</td>
557
                    <td>$def_boot_cmd_line</td>
558
                    <td align=center>$bootstatus</td>
559 560
                    <td>$startupcmd</td>
                    <td align=center>$startstatus</td>
561
                    <td align=center>$readylabel</td>
562 563 564
                 </tr>\n";
	}
	echo "</table>\n";
565 566 567
	echo "<h4><blockquote><blockquote><blockquote><blockquote>
              <dl COMPACT>
                <dt>[1]
568 569
                    <dd>Node has rebooted successfully after experiment
                        creation.
570
                <dt>[2]
571 572 573
                    <dd>Exit value of the node startup command. A value of
                        666 indicates a testbed internal error.
                <dt>[3]
574
                    <dd>User application ready status, reported via TMCC.
575 576
              </dl>
              </blockquote></blockquote></blockquote></blockquote></h4>\n";
577 578 579
    }
}

580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665
#
# Show OS INFO record.
#
function SHOWOSINFO($osid) {
    global $TBDBNAME;
		
    $query_result = mysql_db_query($TBDBNAME,
		"SELECT * FROM os_info WHERE osid='$osid'");

    $osrow = mysql_fetch_array($query_result);

    $os_description = $osrow[description];
    $os_OS          = $osrow[OS];
    $os_version     = $osrow[version];
    $os_path        = $osrow[path];
    $os_magic       = $osrow[magic];
    $os_machinetype = $osrow[machinetype];
    $os_osfeatures  = $osrow[osfeatures];
    $os_pid         = $osrow[pid];

    if (!$os_description)
	$os_description = "&nbsp";
    if (!$os_version)
	$os_version = "&nbsp";
    if (!$os_path)
	$os_path = "&nbsp";
    if (!$os_magic)
	$os_magic = "&nbsp";
    if (!$os_osfeatures)
	$os_osfeatures = "&nbsp";
    if (!$os_pid)
	$os_pid = "&nbsp";

    #
    # Generate the table.
    #
    echo "<table align=center border=1>\n";

    echo "<tr>
            <td>OSID: </td>
            <td class=\"left\">$osid</td>
          </tr>\n";

    echo "<tr>
            <td>Description: </td>
            <td class=\"left\">$os_description</td>
          </tr>\n";

    echo "<tr>
            <td>Operating System: </td>
            <td class=\"left\">$os_OS</td>
          </tr>\n";

    echo "<tr>
            <td>Project: </td>
            <td class=\"left\">$os_pid</td>
          </tr>\n";

    echo "<tr>
            <td>Version: </td>
            <td class=\"left\">$os_version</td>
          </tr>\n";

    echo "<tr>
            <td>Path: </td>
            <td class=\"left\">$os_path</td>
          </tr>\n";

    echo "<tr>
            <td>Magic (uname -r -s): </td>
            <td class=\"left\">$os_magic</td>
          </tr>\n";

    echo "<tr>
            <td>Node Type: </td>
            <td class=\"left\">$os_machinetype</td>
          </tr>\n";

    echo "<tr>
            <td>Features: </td>
            <td class=\"left\">$os_osfeatures</td>
          </tr>\n";

    echo "</table>\n";
}

666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682
#
# Show ImageID record.
#
function SHOWIMAGEID($imageid, $edit) {
    global $TBDBNAME;
		
    $query_result = mysql_db_query($TBDBNAME,
		"SELECT * FROM images WHERE imageid='$imageid'");

    $row = mysql_fetch_array($query_result);

    $description = $row[description];
    $loadpart	 = $row[loadpart];
    $loadlength	 = $row[loadlength];
    $part1_osid	 = $row[part1_osid];
    $part2_osid	 = $row[part2_osid];
    $part3_osid	 = $row[part3_osid];
683 684 685



686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
    $part4_osid	 = $row[part4_osid];
    $default_osid= $row[default_osid];
    $path 	 = $row[path];
    $pid	 = $row[pid];
    $loadaddr	 = $row[load_address];

    if (!$pid)
	$pid = "&nbsp";
    if ($edit) {
	if (!$description)
	    $description = "";
	if (!$path)
	    $path = "";
	if (!$loadaddr)
	    $loadaddr = "";
    }
    else {
	if (!$description)
	    $description = "&nbsp";
	if (!$path)
	    $path = "&nbsp";
	if (!$loadaddr)
	    $loadaddr = "&nbsp";
    }
    
    #
    # Generate the table.
    #
    echo "<table align=center border=2 cellpadding=2 cellspacing=2>\n";

    if ($edit) {
	$imageid_encoded = rawurlencode($imageid);
	
	echo "<form action='editimageid.php3?imageid=$imageid_encoded'
                    method=post>\n";
    }

    echo "<tr>
            <td>ImageID: </td>
            <td class=\"left\">$imageid</td>
          </tr>\n";

    echo "<tr>
            <td>Description: </td>
            <td class=left>\n";

    if ($edit) {
	echo "<input type=text name=description size=60
                     maxlength=256 value='$description'>";
    }
    else {
	echo "$description";
    }
    echo "   </td>
 	  </tr>\n";

    echo "<tr>
            <td>Project: </td>
            <td class=\"left\">$pid</td>
          </tr>\n";

    echo "<tr>
            <td>Load Partition: </td>
            <td class=\"left\">$loadpart</td>
          </tr>\n";

    echo "<tr>
            <td>Load Length: </td>
            <td class=\"left\">$loadlength</td>
          </tr>\n";

    if ($part1_osid) {
	echo "<tr>
                 <td>Slice 1 OSID: </td>
                 <td class=\"left\">
                    <A href='showosinfo.php3?osid=$part1_osid'>$part1_osid</A>
              </tr>\n";
    }

    if ($part2_osid) {
	echo "<tr>
                 <td>Slice 2 OSID: </td>
                 <td class=\"left\">
                    <A href='showosinfo.php3?osid=$part2_osid'>$part2_osid</A>
              </tr>\n";
    }

    if ($part3_osid) {
	echo "<tr>
                 <td>Slice 3 OSID: </td>
                 <td class=\"left\">
                    <A href='showosinfo.php3?osid=$part3_osid'>$part3_osid</A>
              </tr>\n";
    }

    if ($part4_osid) {
	echo "<tr>
                 <td>Slice 4 OSID: </td>
                 <td class=\"left\">
                    <A href='showosinfo.php3?osid=$part4_osid'>$part4_osid</A>
              </tr>\n";
    }

    if ($default_osid) {
	echo "<tr>
                 <td>Default OSID: </td>
                 <td class=\"left\">
                    <A href='showosinfo.php3?osid=$default_osid'>
                       $default_osid</A>
              </tr>\n";
    }

    echo "<tr>
            <td>Path: </td>
            <td class=left>\n";

    if ($edit) {
	echo "<input type=text name=path size=60
                     maxlength=256 value='$path'>";
    }
    else {
	echo "$path";
    }
    echo "  </td>
          </tr>\n";

    echo "<tr>
            <td>Load Address: </td>
            <td class=left>\n";

    if ($edit) {
	echo "<input type=text name=loadaddr size=20
                     maxlength=256 value='$loadaddr'>";
    }
    else {
	echo "$loadaddr";
    }
    echo "  </td>
          </tr>\n";

    if ($edit) {
	echo "<tr>
                 <td colspan=2 align=center>
                     <b><input type=submit value=Submit></b>
                 </td>
              </tr>
              </form>\n";
    }

    echo "</table>\n";
}

Leigh B. Stoller's avatar
Leigh B. Stoller committed
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940
#
# Show node record.
#
function SHOWNODE($node_id) {
    $query_result =
	DBQueryFatal("SELECT * FROM nodes WHERE node_id='$node_id'");
    
    if (mysql_num_rows($query_result) == 0) {
	TBERROR("The node $node_id is not a valid nodeid!", 1);
    }
		
    $row = mysql_fetch_array($query_result);

    $node_id            = $row[node_id]; 
    $type               = $row[type];
    $def_boot_osid      = $row[def_boot_osid];
    $def_boot_path      = $row[def_boot_path];
    $def_boot_cmd_line  = $row[def_boot_cmd_line];
    $next_boot_osid     = $row[next_boot_osid];
    $next_boot_path     = $row[next_boot_path];
    $next_boot_cmd_line = $row[next_boot_cmd_line];
    $rpms               = $row[rpms];
    $tarballs           = $row[tarballs];
    $startupcmd         = $row[startupcmd];

    if (!$def_boot_cmd_line)
	$def_boot_cmd_line = "&nbsp";
    if (!$def_boot_path)
	$def_boot_path = "&nbsp";
    if (!$next_boot_osid)
	$next_boot_osid = "&nbsp";
    if (!$next_boot_path)
	$next_boot_path = "&nbsp";
    if (!$next_boot_cmd_line)
	$next_boot_cmd_line = "&nbsp";
    if (!$rpms)
	$rpms = "&nbsp";
    if (!$tarballs)
	$tarballs = "&nbsp";
    if (!$startupcmd)
	$startupcmd = "&nbsp";

    echo "<table border=2 cellpadding=0 cellspacing=2
                 align=center>\n";

    echo "<tr>
              <td>Node ID:</td>
              <td class=left>$node_id</td>
      </tr>\n";

    echo "<tr>
              <td>Node Type:</td>
              <td class=left>$type</td>
          </tr>\n";

    echo "<tr>
              <td>Def Boot OSID:</td>
              <td class=left>$def_boot_osid</td>
          </tr>\n";

    echo "<tr>
              <td>Def Boot Path:</td>
              <td class=left>$def_boot_path</td>
          </tr>\n";

    echo "<tr>
              <td>Def Boot Command Line:</td>
              <td class=left>$def_boot_cmd_line</td>
          </tr>\n";

    echo "<tr>
              <td>Next Boot OSID:</td>
              <td class=left>$next_boot_osid</td>
          </tr>\n";

    echo "<tr>
             <td>Next Boot Path:</td>
             <td class=left>$next_boot_path</td>
          </tr>\n";

    echo "<tr>
              <td>Next Boot Command Line:</td>
              <td class=left>$next_boot_cmd_line</td>
          </tr>\n";

    echo "<tr>
              <td>Startup Command:</td>
              <td class=left>$startupcmd</td>
          </tr>\n";

    echo "<tr>
              <td>RPMs:</td>
              <td class=left>$rpms</td>
          </tr>\n";

    echo "<tr>
              <td>Tarballs:</td>
              <td class=left>$tarballs</td>
      </tr>\n";

    echo "</table>\n";
}

941 942 943 944
#
# This is an included file.
# 
?>