$const['status95']){ $statusarr[$index]['location'] = $const['examarea']; } else{ $statusarr[$index]['location'] = $const['fordelivery']; }*/ $wm9status = $row['DESCRIPTION']; if ($wm9status == $const['not_started']){ $statusarr[$index]['location'] = $const['returnedarea']; } elseif ($wm9status == $const['ship_complete']){ $statusarr[$index]['location'] = $const['fordelivery']; } else{ $statusarr[$index]['location'] = $const['releasingarea']; } $query = "SELECT SHIPMENTSTATUS.DESCRIPTION FROM SHIPMENTSTATUS WHERE WM9STATUS = '$wm9status'"; $rs2 = mysql_query($query); $row2 = mysql_fetch_assoc($rs2); $statusarr[$index]['status'] = $row2['DESCRIPTION']; $index++; } //get putaway status //move or putaway will always have just one description for status -- Putaway; this is according to the latest table of status from CHI $sql = 'BEGIN '.$warehouse.'.chiweb_getputawaystatus(:i_HAWB, :i_POSTINGDATE, :status_details); END;'; $stmt = oci_parse($conn, $sql); // Bind the input i_HAWB argument to the $hawb PHP variable oci_bind_by_name($stmt,":i_HAWB",$hawb,30); oci_bind_by_name($stmt,":i_POSTINGDATE",$arrvdate,24); // Create a new cursor resource $status_details = oci_new_cursor($conn); // Bind the cursor resource to the Oracle argument oci_bind_by_name($stmt,":status_details",$status_details,-1,SQLT_RSET); // Execute the statement oci_execute($stmt, OCI_DEFAULT); // Execute the cursor oci_execute($status_details); // Use fetchassoc to get rows $row = oci_fetch_assoc($status_details); if (!empty($row['ADDDATE']) && $row['ADDDATE'] != NULL && $row['ADDDATE'] != ''){ $statusarr[$index]['postdt'] = $row['ADDDATE']; $statusarr[$index]['location'] = $const['storage']; $wm9status = $const['mysql_move']; $query = "SELECT SHIPMENTSTATUS.DESCRIPTION FROM SHIPMENTSTATUS WHERE WM9STATUS = '$wm9status'"; $rs2 = mysql_query($query); $row2 = mysql_fetch_assoc($rs2); $statusarr[$index]['status'] = $row2['DESCRIPTION']; $index++; } //get receipt status //according to design specs, receipt will always return ONLY ONE ROW because receipt status does not store a history of status updates $sql = 'BEGIN '.$warehouse.'.chiweb_getreceiptstatus(:i_HAWB, :i_POSTINGDATE, :status_details); END;'; $stmt = oci_parse($conn, $sql); // Bind the input i_HAWB argument to the $hawb PHP variable oci_bind_by_name($stmt,":i_HAWB",$hawb,30); oci_bind_by_name($stmt,":i_POSTINGDATE",$arrvdate,24); // Create a new cursor resource $status_details = oci_new_cursor($conn); // Bind the cursor resource to the Oracle argument oci_bind_by_name($stmt,":status_details",$status_details,-1,SQLT_RSET); // Execute the statement oci_execute($stmt, OCI_DEFAULT); // Execute the cursor oci_execute($status_details); // Use fetchassoc to get rows $row = oci_fetch_assoc($status_details); $receiptkey = $row['RECEIPTKEY']; $statusarr[$index]['postdt'] = $row['DATESTAMP']; $statusarr[$index]['location'] = $const['stagingarea']; $wm9status = $row['DESCRIPTION']; $query = "SELECT SHIPMENTSTATUS.DESCRIPTION FROM SHIPMENTSTATUS WHERE WM9STATUS = '$wm9status'"; $rs2 = mysql_query($query); $row2 = mysql_fetch_assoc($rs2); $statusarr[$index]['status'] = $row2['DESCRIPTION']; $index++; if ($wm9status <> $const['in_receiving']){ //get receipt detail status if shipment is already verified $sql = 'BEGIN '.$warehouse.'.chiweb_getreceiptdetail(:i_RECEIPTKEY, :receipt_details); END;'; $stmt = oci_parse($conn, $sql); oci_bind_by_name($stmt,":i_RECEIPTKEY",$receiptkey,17); // Create a new cursor resource $receipt_details = oci_new_cursor($conn); // Bind the cursor resource to the Oracle argument oci_bind_by_name($stmt,":receipt_details",$receipt_details,-1,SQLT_RSET); // Execute the statement oci_execute($stmt, OCI_DEFAULT); // Execute the cursor oci_execute($receipt_details); // Use fetchassoc to get rows $row = oci_fetch_assoc($receipt_details); $statusarr[$index]['postdt'] = $row['DATESTAMP']; $statusarr[$index]['location'] = $const['stagingarea']; $wm9status = $const['in_receiving']; $query = "SELECT SHIPMENTSTATUS.DESCRIPTION FROM SHIPMENTSTATUS WHERE WM9STATUS = '$wm9status'"; $rs2 = mysql_query($query); $row2 = mysql_fetch_assoc($rs2); $statusarr[$index]['status'] = $row2['DESCRIPTION']; $index++; } } usort($statusarr, "cmp"); return $statusarr; } ini_set("soap.wsdl_cache_enabled", "0"); $server = new SoapServer("ws_status.wsdl"); $server->addFunction("GetMatchedRecords"); $server->addFunction("GetShipmentDetails"); $server->addFunction("GetShipmentStatus"); $server->handle(); ?>