IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 43008


Ignore:
Timestamp:
May 3, 2026, 2:51:33 PM (4 days ago)
Author:
eugene
Message:

need to check for element requests in SESSION before using; need to use mysqli_fetch_assoc to get a named entry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/pstamp/web/submitted.php

    r42996 r43008  
    129129{
    130130  $debug_listing = 0;
     131
     132  if (!isset($_SESSION['requests'])) {
     133    if ($debug_listing) {
     134        echo "<br /><br />no requests (yet) in session\n";
     135    }
     136    return;
     137  }
     138
    131139  $request_count = count($_SESSION['requests']);
     140
    132141  $dbconnection = 0;
    133142 
     143  // EAM TEST:
    134144  // echo "request_count: $request_count<br />";
    135145
    136     for ($i = $request_count-1; $i >= 0; $i--) {
     146  for ($i = $request_count-1; $i >= 0; $i--) {
     147
    137148        // unserialize the object
    138149        $ser_req = $_SESSION['requests'][$i];
     
    144155
    145156        $name = $req->name;
    146         $id = $req->id;
     157        $id = (int) $req->id;
    147158
    148159        if ($id && ($req->state != "stop")) {
     
    170181
    171182            // EAM : new PHP version (we only need row 0 to replicate the old behavior)
    172             mysqli_data_seek($result, 0);
    173             $row = mysqli_fetch_row($result);
     183            // mysqli_data_seek($result, 0);
     184            $row = mysqli_fetch_assoc($result);
     185            if (!$row) {
     186              echo " funny value in cookies, no entry matches req_id $id<br>\n";
     187              continue;
     188            }
    174189            $req->state      = $row['state'];
    175190            $req->num_jobs   = $row['num_jobs'];
     
    182197        echo "request id: $id";
    183198        echo "&nbsp;&nbsp;";
    184         echo " State: $req->state  Num Jobs: $req->num_jobs \n";
     199        echo " State: $req->state &nbsp;&nbsp; Num Jobs: $req->num_jobs &nbsp;&nbsp;\n";
    185200        if ($req->state == "stop") {
    186201            // Job is done output fileset as link.
Note: See TracChangeset for help on using the changeset viewer.