Changeset 35 for trunk/runID_info.php
- Timestamp:
- Apr 8, 2018, 4:41:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/runID_info.php
r15 r35 28 28 29 29 global $uses_airavata; 30 global $link; 30 31 31 32 ?> … … 62 63 function experiment_select( $select_name, $current_ID = NULL ) 63 64 { 65 global $link; 64 66 $myID = $_SESSION['id']; 65 67 … … 72 74 $users_clause . 73 75 "ORDER BY lname, runID "; 74 $result = mysql _query($query )75 or die( "Query failed : $query<br />" . mysql _error() );76 77 if ( mysql _num_rows( $result ) == 0 ) return "";76 $result = mysqli_query( $link, $query ) 77 or die( "Query failed : $query<br />" . mysqli_error($link) ); 78 79 if ( mysqli_num_rows( $result ) == 0 ) return ""; 78 80 79 81 $text = "<form action='{$_SERVER['PHP_SELF']}' method='post'>\n" . 80 82 " <select name='$select_name' size='1' onchange='form.submit();'>\n" . 81 83 " <option value=-1>Please select...</option>\n"; 82 while ( list( $experimentID, $runID, $lname ) = mysql _fetch_array( $result ) )84 while ( list( $experimentID, $runID, $lname ) = mysqli_fetch_array( $result ) ) 83 85 { 84 86 $selected = ( $current_ID == $experimentID ) ? " selected='selected'" : ""; … … 95 97 function runID_info( $experimentID ) 96 98 { 99 global $link; 97 100 $query = "SELECT people.personID, personGUID, lname, fname, email " . 98 101 "FROM experiment, projectPerson, people " . … … 100 103 "AND experiment.projectID = projectPerson.projectID " . 101 104 "AND projectPerson.personID = people.personID "; 102 $result = mysql _query($query )103 or die( "Query failed : $query<br />\n" . mysql _error() );104 list( $ID, $GUID, $lname, $fname, $email ) = mysql _fetch_array( $result );105 $result = mysqli_query( $link, $query ) 106 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 107 list( $ID, $GUID, $lname, $fname, $email ) = mysqli_fetch_array( $result ); 105 108 106 109 $text = <<<HTML … … 126 129 "WHERE experimentID = $experimentID " . 127 130 "AND experiment.rotorCalibrationID = rotorCalibration.rotorCalibrationID "; 128 $result = mysql _query($query )129 or die( "Query failed : $query<br />\n" . mysql _error() );130 list( $GUID, $coeff1, $coeff2, $type, $runType ) = mysql _fetch_array( $result );131 $result = mysqli_query( $link, $query ) 132 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 133 list( $GUID, $coeff1, $coeff2, $type, $runType ) = mysqli_fetch_array( $result ); 131 134 $text .= <<<HTML 132 135 <table cellspacing='0' cellpadding='0' class='admin'> … … 154 157 "WHERE experimentID = $experimentID " . 155 158 "ORDER BY filename "; 156 $result = mysql _query($query )157 or die( "Query failed : $query<br />\n" . mysql _error() );158 159 if ( mysql _num_rows( $result ) == 0 )159 $result = mysqli_query( $link, $query ) 160 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 161 162 if ( mysqli_num_rows( $result ) == 0 ) 160 163 return $text; 161 164 … … 176 179 HTML; 177 180 178 while ( list( $ID, $GUID, $filename, $solutionID ) = mysql _fetch_array( $result ) )181 while ( list( $ID, $GUID, $filename, $solutionID ) = mysqli_fetch_array( $result ) ) 179 182 { 180 183 $rawIDs[] = $ID; … … 200 203 "WHERE rawDataID IN ( $rawIDs_csv ) " . 201 204 "ORDER BY editedDataID, filename "; 202 $result = mysql _query($query )203 or die( "Query failed : $query<br />\n" . mysql _error() );204 205 if ( mysql _num_rows( $result ) == 0 )205 $result = mysqli_query( $link, $query ) 206 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 207 208 if ( mysqli_num_rows( $result ) == 0 ) 206 209 return $text; 207 210 … … 222 225 223 226 $editIDs = array(); 224 while ( list ( $editID, $rawID, $GUID, $filename ) = mysql _fetch_array( $result ) )227 while ( list ( $editID, $rawID, $GUID, $filename ) = mysqli_fetch_array( $result ) ) 225 228 { 226 229 $editIDs[] = $editID; … … 245 248 "WHERE editedDataID IN ( $editIDs_csv ) " . 246 249 "ORDER BY modelID "; 247 $result = mysql _query($query )248 or die( "Query failed : $query<br />\n" . mysql _error() );249 250 if ( mysql _num_rows( $result ) != 0 )250 $result = mysqli_query( $link, $query ) 251 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 252 253 if ( mysqli_num_rows( $result ) != 0 ) 251 254 { 252 255 $text .= <<<HTML … … 268 271 269 272 $modelIDs = array(); 270 while ( list ( $modelID, $editID, $GUID, $variance, $meniscus, $personID ) = mysql _fetch_array( $result ) )273 while ( list ( $modelID, $editID, $GUID, $variance, $meniscus, $personID ) = mysqli_fetch_array( $result ) ) 271 274 { 272 275 $modelIDs[] = $modelID; … … 295 298 "WHERE modelID IN ( $modelIDs_csv ) " . 296 299 "ORDER BY noiseID "; 297 $result = mysql _query($query )298 or die( "Query failed : $query<br />\n" . mysql _error() );299 300 if ( mysql _num_rows( $result ) != 0 )300 $result = mysqli_query( $link, $query ) 301 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 302 303 if ( mysqli_num_rows( $result ) != 0 ) 301 304 { 302 305 $text .= <<<HTML … … 317 320 HTML; 318 321 319 while ( list ( $noiseID, $GUID, $editID, $modelID, $modelGUID, $type ) = mysql _fetch_array( $result ) )322 while ( list ( $noiseID, $GUID, $editID, $modelID, $modelGUID, $type ) = mysqli_fetch_array( $result ) ) 320 323 { 321 324 $text .= <<<HTML … … 340 343 "WHERE editedDataID IN ( $editIDs_csv ) " . 341 344 "ORDER BY noiseID "; 342 $result = mysql _query($query )343 or die( "Query failed : $query<br />\n" . mysql _error() );344 345 if ( mysql _num_rows( $result ) != 0 )345 $result = mysqli_query( $link, $query ) 346 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 347 348 if ( mysqli_num_rows( $result ) != 0 ) 346 349 { 347 350 $text .= <<<HTML … … 362 365 HTML; 363 366 364 while ( list ( $noiseID, $GUID, $editID, $modelID, $modelGUID, $type ) = mysql _fetch_array( $result ) )367 while ( list ( $noiseID, $GUID, $editID, $modelID, $modelGUID, $type ) = mysqli_fetch_array( $result ) ) 365 368 { 366 369 $text .= <<<HTML … … 386 389 "ORDER BY reportID "; 387 390 388 $result = mysql _query($query )389 or die( "Query failed : $query<br />\n" . mysql _error() );390 391 if ( mysql _num_rows( $result ) != 0 )391 $result = mysqli_query( $link, $query ) 392 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 393 394 if ( mysqli_num_rows( $result ) != 0 ) 392 395 { 393 396 $text .= <<<HTML … … 405 408 HTML; 406 409 407 while ( list ( $reportID, $GUID, $title ) = mysql _fetch_array( $result ) )410 while ( list ( $reportID, $GUID, $title ) = mysqli_fetch_array( $result ) ) 408 411 { 409 412 $reportIDs[] = $reportID; … … 430 433 "ORDER BY reportID, reportTripleID "; 431 434 432 $result = mysql _query($query )433 or die( "Query failed : $query<br />\n" . mysql _error() );434 435 if ( mysql _num_rows( $result ) != 0 )435 $result = mysqli_query( $link, $query ) 436 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 437 438 if ( mysqli_num_rows( $result ) != 0 ) 436 439 { 437 440 $text .= <<<HTML … … 453 456 454 457 while ( list ( $reportTripleID, $GUID, $resultID, $triple, $dataDesc, $rptID ) 455 = mysql _fetch_array( $result ) )458 = mysqli_fetch_array( $result ) ) 456 459 { 457 460 $reportTripleIDs[] = $reportTripleID; … … 483 486 "ORDER BY reportTripleID, reportDocumentID "; 484 487 485 $result = mysql _query($query )486 or die( "Query failed : $query<br />\n" . mysql _error() );487 488 if ( mysql _num_rows( $result ) != 0 )488 $result = mysqli_query( $link, $query ) 489 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 490 491 if ( mysqli_num_rows( $result ) != 0 ) 489 492 { 490 493 $text .= <<<HTML … … 507 510 while ( list ( $reportDocumentID, $GUID, $editID, $label, $filename, 508 511 $analysis, $subAnal, $docType, $tripID ) 509 = mysql _fetch_array( $result ) )512 = mysqli_fetch_array( $result ) ) 510 513 { 511 514 $text .= <<<HTML … … 531 534 "WHERE experimentID = $experimentID " . 532 535 "ORDER BY HPCAnalysisRequestID "; 533 $result = mysql _query($query )534 or die( "Query failed : $query<br />\n" . mysql _error() );535 536 if ( mysql _num_rows( $result ) == 0 )536 $result = mysqli_query( $link, $query ) 537 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 538 539 if ( mysqli_num_rows( $result ) == 0 ) 537 540 return $text; 538 541 … … 554 557 HTML; 555 558 556 while ( list( $ID, $GUID, $filename, $submit, $cluster, $method ) = mysql _fetch_array( $result ) )559 while ( list( $ID, $GUID, $filename, $submit, $cluster, $method ) = mysqli_fetch_array( $result ) ) 557 560 { 558 561 $requestIDs[] = $ID; … … 579 582 "WHERE HPCAnalysisRequestID IN ( $requestIDs_csv ) " . 580 583 "ORDER BY HPCAnalysisResultID "; 581 $result = mysql _query($query )582 or die( "Query failed : $query<br />\n" . mysql _error() );583 584 if ( mysql _num_rows( $result ) != 0 )584 $result = mysqli_query( $link, $query ) 585 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 586 587 if ( mysqli_num_rows( $result ) != 0 ) 585 588 { 586 589 $text .= <<<HTML … … 600 603 601 604 $incomplete = array(); 602 while ( list( $ID, $requestID, $gfacID, $status, $updated ) = mysql _fetch_array( $result ) )605 while ( list( $ID, $requestID, $gfacID, $status, $updated ) = mysqli_fetch_array( $result ) ) 603 606 { 604 607 if ( $status != 'completed' ) … … 628 631 global $globaldbhost, $globaldbuser, $globaldbpasswd, $globaldbname; 629 632 630 $globaldb = mysql _connect( $globaldbhost, $globaldbuser, $globaldbpasswd);633 $globaldb = mysqli_connect( $globaldbhost, $globaldbuser, $globaldbpasswd, $globaldbname ); 631 634 632 635 if ( ! $globaldb ) 633 636 { 634 $text .= "<p>Cannot open global database on $globaldbhost</p>\n"; 635 return $text; 636 } 637 638 if ( ! mysql_select_db( $globaldbname, $globaldb ) ) 639 { 640 $text .= "<p>Cannot change to global database $globaldbname</p>\n"; 637 $text .= "<p>Cannot open global database on $globaldbhost : $globaldbname</p>\n"; 641 638 return $text; 642 639 } … … 665 662 "FROM analysis " . 666 663 "WHERE gfacID = '$gfacID' "; 667 $result = mysql _query($query )668 or die( "Query failed : $query<br />\n" . mysql _error() );669 670 if ( mysql _num_rows( $result ) == 1 )664 $result = mysqli_query( $link, $query ) 665 or die( "Query failed : $query<br />\n" . mysqli_error($link) ); 666 667 if ( mysqli_num_rows( $result ) == 1 ) 671 668 { 672 669 $in_queue++; 673 list( $cluster, $db, $status, $msg, $time ) = mysql _fetch_array( $result );670 list( $cluster, $db, $status, $msg, $time ) = mysqli_fetch_array( $result ); 674 671 $text .= <<<HTML 675 672 <tr><td>$gfacID</td> … … 691 688 "</table>\n"; 692 689 693 mysql _close( $globaldb );690 mysqli_close( $globaldb ); 694 691 695 692 return $text; … … 698 695 function HPCDetail( $requestID ) 699 696 { 697 global $link; 700 698 $query = "SELECT * FROM HPCAnalysisRequest WHERE HPCAnalysisRequestID=$requestID"; 701 $result = mysql _query($query )702 or die( "Query failed : $query<br />\n" . mysql _error());703 $row = mysql _fetch_assoc( $result );699 $result = mysqli_query( $link, $query ) 700 or die( "Query failed : $query<br />\n" . mysqli_error($link)); 701 $row = mysqli_fetch_assoc( $result ); 704 702 $row['requestXMLFile'] = '<pre>' . htmlentities( $row['requestXMLFile'] ) . '</pre>'; 705 703 … … 722 720 723 721 $query = "SELECT * FROM HPCAnalysisResult WHERE HPCAnalysisRequestID=$requestID"; 724 $result = mysql _query($query )725 or die( "Query failed : $query<br />\n" . mysql _error());726 $row = mysql _fetch_assoc( $result );722 $result = mysqli_query( $link, $query ) 723 or die( "Query failed : $query<br />\n" . mysqli_error($link)); 724 $row = mysqli_fetch_assoc( $result ); 727 725 $row['jobfile'] = '<pre>' . htmlentities( $row['jobfile'] ) . '</pre>'; 728 726 … … 761 759 "WHERE HPCAnalysisResultID = $resultID " . 762 760 "AND HPCAnalysisResultType = 'model' "; 763 $result = mysql _query($query )764 or die( "Query failed : $query<br />\n" . mysql _error());765 $models = mysql _fetch_row( $result ); // An array with all of them761 $result = mysqli_query( $link, $query ) 762 or die( "Query failed : $query<br />\n" . mysqli_error($link)); 763 $models = mysqli_fetch_row( $result ); // An array with all of them 766 764 if ( $models !== false ) 767 765 $row['modelIDs'] = implode( ", ", $models ); … … 770 768 "WHERE HPCAnalysisResultID = $resultID " . 771 769 "AND HPCAnalysisResultType = 'noise' "; 772 $result = mysql _query($query )773 or die( "Query failed : $query<br />\n" . mysql _error());774 $noise = mysql _fetch_row( $result ); // An array with all of them770 $result = mysqli_query( $link, $query ) 771 or die( "Query failed : $query<br />\n" . mysqli_error($link)); 772 $noise = mysqli_fetch_row( $result ); // An array with all of them 775 773 if ( $noise !== false ) 776 774 $row['noiseIDs'] = implode( ", ", $noise );
Note:
See TracChangeset
for help on using the changeset viewer.