Trip Sheet PDF Load Number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SandDoller
    Administrator
    • Jul 2025
    • 22

    #1

    Trip Sheet PDF Load Number

    Okay, I have it where you can click on the button to download the trip sheet in a PDF file to your computer. It pops-up with a rename the PDF. Right now it comes up with Trip Sheet.pdf I want it to have the Load Number at the end. So it would look like this: Trip Sheet 12342.pdf
    I can not figure out how to have it put the load number in. I have tried all sorts of ways. Even asked on the PHPRunner Forum. No Help and they closed the thread on me.. Here is the link:

    Here is my button codes:

    Client Before:
    Code:
    ajax.addPDF( 'pdf', {}, function() {
     
      return ctrl.dialog( {
         title: 'Save results as PDF',
         fields: [{
            name: 'filename',
            value: 'TripSheet.pdf'
         }]
      });
    });
    return false;
    Server:
    Code:
    $record = $button->getCurrentRecord();
    $result["trip_number"]=$record["trip_number"];
    
    $filename = str_replace( array( '/', '\\'), '', $params["filename"]);
    
    $dot = strrpos( $filename, "." );
    if( strtolower(substr( $filename, $dot )) !== '.pdf' ) {
      $filename .= '.pdf';
    }
    file_put_contents( $filename, $params["pdf"] );​
    Client After:
    Code:
    window.open( params['filename'] );
    This button is on the Trip Sheet page and my data value I need is trip_number
Tandy Services Coding problems

About this Group

This is a place I will have to try to figure out the coding I am working on. Least a list of problems I am having and might come up with a fix.
Type: Public
Topics: 2
Comments: 0

Members (1)

Latest Group Topics

Collapse

Working...