fixed: show no slices when user has no slices
[plewww.git] / planetlab / sirius / index.php
index 71ea772..37559f6 100644 (file)
@@ -110,8 +110,8 @@ function authorizeSlice($sn) {
        global $api;
   
   $slice_list= array();
-  $result= $api->GetSlices( $slice_list, array( "name" ) );
-  
+  $result= $api->GetSlices( Null, array( "name" ) );
+
   foreach ( $result AS $slice )
   {
        if ( $slice["name"] == $sn )
@@ -584,7 +584,7 @@ function findNextQueue($units, $timesOccupied, $arr) {
        // green background will mean slot is open, and red will mean the slot is used
        // 
   echo "<table cellspacing=\"2\" cellpadding=\"1\" border=\"0\" width=550>\n";
-  echo "<tr><td colspan=\"3\"><strong>24 hour Queue:</strong> Choose the GMT time slot you desire (<font color=\"#339933\">green</font> slots are open, <font color=\"#CC3333\">red</font> are taken) <p></td></tr>\n";
+  echo "<tr><td colspan=\"3\"><span class='bold'>24 hour Queue:</span> Choose the GMT time slot you desire (<font color=\"#339933\">green</font> slots are open, <font color=\"#CC3333\">red</font> are taken) <p></td></tr>\n";
   echo "<tr><td width=\"47%\" align=\"right\"><table cellspacing=1 cellpadding=1 border=0 width=130>\n";
 
   // here's what this does below: it goes through each hour, and sees if the slot is occupied
@@ -681,7 +681,13 @@ function sliceDropDown() {
   
   $slice_list= array();
   $result= $api->GetSlices( Null, array( "name" ) );
-  sort_slices( $result );
+
+  // sort_slices( $result ); --> slice sort on name
+  function __cmp_slices($a, $b) {
+    return strcasecmp($a['name'], $b['name']);
+  }
+  usort($result, '__cmp_slices');
+
   foreach ( $result AS $slice )
   {
        echo "<option value='" . $slice["name"] . "'>" . $slice["name"] . "\n";