- Timestamp:
- 03/29/13 17:15:20 (11 years ago)
- Location:
- branches/0.4/web/addons/job_monarch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/web/addons/job_monarch/libtoga.php
r767 r778 97 97 global $JOB_ARCHIVE_DIR; 98 98 global $JOB_ARCHIVE_DBASE; 99 global $JOB_ARCHIVE_SQL_USER; 100 global $JOB_ARCHIVE_SQL_PASSWORD; 99 101 global $skan_str; 100 102 global $x_first, $y_first; … … 160 162 var $ip, $dbase, $conn; 161 163 162 function TarchDbase( $ip = null, $dbase = null )164 function TarchDbase( $ip = null, $dbase = null, $user =null, $password=null ) 163 165 { 164 166 global $CLUSTER_CONFS, $clustername; … … 184 186 function connect() 185 187 { 188 global $JOB_ARCHIVE_SQL_USER, $JOB_ARCHIVE_SQL_PASSWORD; 189 190 $connect_args =''; 186 191 if( $this->ip == null ) 187 $this->conn = pg_connect( "dbname=".$this->dbase ); 192 { 193 $connect_args .= "dbname=".$this->dbase; 194 } 188 195 else 189 $this->conn = pg_connect( "host=".$this->ip." dbname=".$this->dbase ); 196 { 197 $connect_args .= "host=".$this->ip." dbname=".$this->dbase; 198 } 199 if( isset($JOB_ARCHIVE_SQL_USER) ) 200 { 201 $connect_args .= " user=".$JOB_ARCHIVE_SQL_USER; 202 } 203 if( isset($JOB_ARCHIVE_SQL_PASSWORD) ) 204 { 205 $connect_args .= " password=".$JOB_ARCHIVE_SQL_PASSWORD; 206 } 207 208 209 $this->conn = pg_connect( $connect_args ); 210 190 211 } 191 212 … … 260 281 261 282 $ids = $this->queryDbase( $select_query ); 283 284 //print_r( $ids ); 262 285 263 286 $ret = array(); … … 335 358 { 336 359 $result_rows = array(); 337 338 if( !$this->conn)360 361 if( $this->conn == null ) 339 362 { 340 363 $this->connect(); 341 364 } 342 365 366 if( $this->conn == null ) 367 { 368 printf(" no connection!\n"); 369 } 343 370 $result = pg_query( $this->conn, $query ); 344 371 345 372 while ($row = pg_fetch_assoc($result)) 346 373 { 374 //print_r( $row ); 347 375 $result_rows[] = $row; 348 376 } -
branches/0.4/web/addons/job_monarch/search.php
r776 r778 33 33 global $end_from_time, $end_to_time, $period_start, $period_stop, $tpl_data; 34 34 35 $error = 0;35 $error = false; 36 36 $error_msg = "<FONT COLOR=\"red\"><B>"; 37 37 $show_msg = 0; … … 40 40 41 41 if( $id == '' and $owner== '' and $name == '' and $start_from_time == '' and $start_to_time == '' and $queue == '' and $end_from_time == '' and $end_to_time == '') { 42 $error = 1;42 $error = true; 43 43 $show_msg = 1; 44 44 $error_msg .= "No search criteria set!"; … … 48 48 { 49 49 50 $error = 1;50 $error = true; 51 51 $show_msg = 1; 52 52 $error_msg .= "Id must be a number"; … … 64 64 65 65 $show_msg = 1; 66 $error = true; 66 67 $error_msg .= "Graph timeperiod reset: start date/time can't be later than end"; 67 68 $period_stop = ''; … … 70 71 71 72 $show_msg = 1; 73 $error = true; 72 74 $error_msg .= "Graph timeperiod reset: start and end date/time can't be the same"; 73 75 $period_stop = ''; … … 78 80 79 81 $error_msg .= "</B></FONT>"; 80 // doe checks en set error en error_msg in case shit 81 82 //if( $show_msg ) 83 //$tpl_data->assign( "form_error_msg", $error_msg ); 84 85 return ($error ? 0 : 1 ); 82 83 return array( $error_msg, $error); 86 84 } 87 85 … … 256 254 $tpl_data->assign( "end_to_value", rawurldecode( $end_to_time ) ); 257 255 258 if( validateFormInput() ) { 259 256 list( $form_error_msg, $form_error ) = validateFormInput(); 257 258 if( $form_error == true ) 259 { 260 $tpl_data->assign( "form_error_msg", $form_error_msg ); 261 } 262 else if( $form_error == false ) 263 { 260 264 $tpl_data->assign( "search_results", "yes" ); 261 265 $tpl_data->assign( "sortby", $sortby); … … 268 272 $search_ids = $tdb->searchDbase( $id, $queue, $owner, $name, $start_from_time, $start_to_time, $end_from_time, $end_to_time ); 269 273 274 //print_r( $search_ids ); 270 275 if( ($tdb->resultcount) > (int) $SEARCH_RESULT_LIMIT ) { 271 276 272 277 $tpl_data->assign( "form_error_msg", "Got " . $tdb->resultcount . " search results, output limited to last " . $SEARCH_RESULT_LIMIT . " jobs." ); 273 278 } … … 350 355 $node_loop[]=$node_list; 351 356 } 352 $tpl_data->assign("node_loop", $node_loop ); 357 //print_r( $node_loop ); 358 $tpl_data->assign("node_list", $node_loop ); 353 359 354 360 if( count( $search_ids ) == 1 ) { … … 463 469 $sorted_loop[]=$sorted_list; 464 470 } 465 $tpl_data->assign("sorted_loop", $sorted_loop ); 466 471 $tpl_data->assign("sorted_list", $sorted_loop ); 467 472 } 468 473 } -
branches/0.4/web/addons/job_monarch/templates/search.tpl
r776 r778 197 197 {$form_error_msg}<BR><BR> 198 198 199 {if "$search_results" == " 199 {if "$search_results" == "yes" } 200 200 201 201 <INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{$sortby}"> … … 223 223 </TR> 224 224 225 {loop $node }225 {loop $node_list} 226 226 <TR CLASS="{$nodeclass}"> 227 227 <TD><A HREF="#" onClick="setFilter( 'id', '{$id}' )">{$id}</A></TD>
Note: See TracChangeset
for help on using the changeset viewer.