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:
Server:
Client After:
This button is on the Trip Sheet page and my data value I need is trip_number
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;
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"] );?
Code:
window.open( params['filename'] );