I am looking for some basic Hello World code then would like to expand from there.
First
Upon clicking on a button Event
Inside function OnServer($params, $result)
$new_file_name = date('Y-m-d');
$new_file_name = "relative_path/" . $new_file_name . ".txt";
$file_saved_on_server = fopen($new_file_name, "w");
$txt_to_write = "I love Donald Duck\n";
fwrite($file_saved_on_server, $txt_to_write);
fclose($file_saved_on_server);
So I need to know where is best practice to put this file using PhpRunner, path wise, and what works. My syntax above may not be perfect.
Second
Once I understand this, then I will.
SELECT some fields from some table like customer invoices.
Loop through and create multiple files, for example new files so I can have each customers invoices in separate files, each with unique file names.
Will basically be the same as above.
Third
I will attach the files from the server directory to send emails to different directory, likely using runner_mail.
$attachments = array();
Fourth
I wish to create pdf files instead of simple text files, and I am hoping to use some straightforward pre written and tested code, not finding it yet.
Thank you much