Index: /branches/0.4/web/addons/job_monarch/libtoga.php
===================================================================
--- /branches/0.4/web/addons/job_monarch/libtoga.php	(revision 712)
+++ /branches/0.4/web/addons/job_monarch/libtoga.php	(revision 713)
@@ -4,5 +4,5 @@
  * This file is part of Jobmonarch
  *
- * Copyright (C) 2006  Ramon Bastiaans
+ * Copyright (C) 2006-2013  Ramon Bastiaans
  *
  * Jobmonarch is free software; you can redistribute it and/or modify
@@ -106,5 +106,4 @@
 chdir( $GANGLIA_PATH );
 
-//include_once "./conf.php";
 include_once "./eval_conf.php";
 include_once "./functions.php";
@@ -487,5 +486,5 @@
 		if( !$fp )
 		{
-			echo 'Unable to connect to '.$this->ip.':'.$this->port; // printf( 'Unable to connect to [%s:%.0f]', $this->ip, $this->port );
+			echo 'Unable to connect to '.$this->ip.':'.$this->port;
 			return;
 		}
Index: /branches/0.4/web/addons/job_monarch/search.php
===================================================================
--- /branches/0.4/web/addons/job_monarch/search.php	(revision 712)
+++ /branches/0.4/web/addons/job_monarch/search.php	(revision 713)
@@ -4,5 +4,5 @@
  * This file is part of Jobmonarch
  *
- * Copyright (C) 2006  Ramon Bastiaans
+ * Copyright (C) 2006-2013  Ramon Bastiaans
  *
  * Jobmonarch is free software; you can redistribute it and/or modify
@@ -41,5 +41,6 @@
 	}
 
-	if( !is_numeric($id) and !$error and $id != '') {
+	if( !is_numeric($id) and !$error and $id != '') 
+    {
 
 		$error = 1;
@@ -48,14 +49,11 @@
 	}
 
-	//printf( "period_start = %s period_stop = %s\n", $period_start, $period_stop );
-
-	if( !$error and $period_start != '' ) {
-		//printf( "period_start = %s period_stop = %s\n", $period_start, $period_stop );
+	if( !$error and $period_start != '' ) 
+    {
 		$pstart_epoch = datetimeToEpoch( $period_start );
-		//printf( "period_start = %s period_stop = %s\n", $period_start, $period_stop );
-		if( $period_stop != '' ) {
+		if( $period_stop != '' ) 
+        {
 
 			$pstop_epoch = datetimeToEpoch( $period_stop );
-			//printf( "pstop_epoch = %s pstart_epoch = %s\n", $pstop_epoch, $pstart_epoch );
 
 			if( $pstart_epoch > $pstop_epoch ) {
@@ -84,11 +82,6 @@
 }
 
-//function makeDate( $time ) {
-//        return strftime( "%a %d %b %Y %H:%M:%S", $time );
-//}
-
 function datetimeToEpoch( $datetime ) {
 
-	//printf("datetime = %s\n", $datetime );
 	$datetime_fields = explode( ' ', $datetime );
 
@@ -102,6 +95,4 @@
 	$years = $date_fields[2];
 
-	//printf( "days = %s months = %s years = %s\n", $days, $months, $years );
-
 	$time_fields = explode( ':', $time );
 
@@ -110,9 +101,5 @@
 	$seconds = $time_fields[2];
 
-	//printf( "hours = %s minutes = %s seconds = %s\n", $hours, $minutes, $seconds );
-
 	$timestamp = mktime( $hours, $minutes, $seconds, $months, $days, $years );
-
-	//printf( "timestamp = %s\n", $timestamp );
 
 	return $timestamp;
@@ -149,6 +136,4 @@
 function sortJobs( $jobs, $nodes, $sortby, $sortorder ) {
 
-	//printf("sortby = %s sortorder = %s\n", $sortby, $sortorder );
-
         $sorted = array();
 
@@ -162,6 +147,4 @@
                 "else if (\$sortorder==\"asc\")".
                         "return ( \$a > \$b ) ? 1 : -1;" );
-
-	//print_r( $jobs );
 
         foreach( $jobs as $jobid => $jobattrs ) {
@@ -237,11 +220,8 @@
         }
 
-        //uasort( $sorted, $cmp );
         if( $sortorder == "asc" )
                 arsort( $sorted );
         else if( $sortorder == "desc" )
                 asort( $sorted );
-
-	//print_r( $sorted );
 
         return array_keys( $sorted );
@@ -253,9 +233,4 @@
 	global $period_start, $period_stop, $sortby, $sortorder, $COLUMN_REQUESTED_MEMORY;
 	global $SEARCH_RESULT_LIMIT, $COLUMN_NODES, $metricname;
-
-	//$metricname = $m;
-	//printf("job_start = %s job_stop = %s\n", $job_start, $job_stop );
-	//printf("start = %s stop = %s\n", $start, $stop );
-	//printf("m %s\n", $metricname );
 
 	$longtitle = "Batch Archive Search :: Powered by Job Monarch!";
@@ -298,9 +273,6 @@
 		$even = 1;
 
-		//print_r( $search_ids );
-
 		foreach( $search_ids as $myid ) {
 
-			//printf( "myid %s\n", $myid );
 			$jobs[$myid] = $tdb->getJobArray( $myid );
 			$nodes[$myid] = $tdb->getNodesForJob( $myid );
@@ -314,17 +286,10 @@
 		}
 
-		//print_r( $nodes );
 		$sorted_search = sortJobs( $jobs, $nodes, $sortby, $sortorder );
 
-		//print_r( $sorted_search );
 		foreach( $sorted_search as $sortid ) {
 
 			$job = $jobs[$sortid];
-			//print_r( $job );
 			$foundid = $job['id'];
-			//printf( "foundid %s\n", $foundid );
-
-			//$job = $tdb->getJobArray( $foundid );
-			//$nodes = $tdb->getNodesForJob( $foundid );
 
 			$tpl->newBlock( "node" );
@@ -379,6 +344,4 @@
 			$tpl->assign( "runningtime", makeTime( $runningtime ) );
 			
-			//print_r( $job );
-			//print_r( $nodes );
 		}
 
@@ -388,5 +351,4 @@
 
 			$showhosts = isset($sh) ? $sh : $default_showhosts;
-			//if( !$showhosts) $showhosts = $default_showhosts;
 			$tpl->assign("checked$showhosts", "checked");
 
@@ -410,8 +372,4 @@
 
 			if( $showhosts ) {
-				//bla
-
-				//printf("job_start = %s job_stop = %s\n", $job_start, $job_stop );
-				//printf("start = %s stop = %s\n", $start, $stop );
 
 				if( !$period_start ) // Add an extra 10% to graphstart
@@ -425,6 +383,4 @@
 					$period_stop = datetimeToEpoch( $period_stop );
 
-				//printf("start = %s stop = %s\n", $start, $stop );
-
 		                $tpl->gotoBlock( "timeperiod" );
 
@@ -442,5 +398,4 @@
 
 				foreach ($hosts_up as $host ) {
-					//$host = $host. '.'.$job_domain;
 					$cpus = $metrics[$host]["cpu_num"]['VAL'];
 					if (!$cpus) $cpus=1;
@@ -467,6 +422,4 @@
 				}
 
-				//$sorted_hosts = array_merge($down_hosts, $sorted_hosts);
-
 				# First pass to find the max value in all graphs for this
 				# metric. The $start,$end variables comes from get_context.php,
@@ -478,11 +431,8 @@
 				foreach ( $sorted_hosts as $host=>$value  ) {
 					$tpl->newBlock ("sorted_list");
-					//$host = $host. '.'.$domain;
 					$host_url = rawurlencode($host);
 					$cluster_url = rawurlencode($clustername);
 
 					$textval = "";
-					//printf("host = %s, value = %s", $host, $value);
-					//echo "$host: $value, ";
 					$val = $metrics[$host][$metricname];
 					$class = "metric";
@@ -507,5 +457,4 @@
 				}
 
-				//einde bla
 			}
 		}
