This topic is locked
[SOLVED]

 Print Pdf button on list page

3/11/2014 10:52:15 AM
PHPRunner General questions
A
Abul author

Hello Dear,

I got stuck at the end of my order submit app development. Please help me out. After submission an order customer needs to have the whole order information in a pdf file. In order to available this feature, I need to insert a BUTTON or any link text like "Print Pdf" in the grid of the order list page. I need this button to fire up an external order_pdf.php (a custom pdf writing file created by FPDF lib and example Mysql Table) page to create whole purchase order in pdf on the fly.
I have created order_view table in my database from order, customer, products and billing info tables. I am using this order_view table to retrieve whole order information into my order_pdf.php page by sql query with WHERE clause such as:

$pdf->Table("select ordno, fname, lname from ord_view where ord_id=".$ord_id,$prop);


The ord_id field in order_view table is the alais field of "id" (order table). I am trying to pass order (id) from the order list page to my order_pdf.php page by using $_GET['id'] with no luck on button click. And even the button is not working with $_GET['ord_id']. However, if I run a url like http://localhost/test/order_pdf.php?ord_id=2 or 3 then it works but the button click is not functioned. I used so many tips from the forum such as this and this probably more potential with no luck.
So basically I just need to insert a button for each record on order list page and have that button pass the ID of the record, so my external order_pdf.php page can be run to produce whole order pdf on the fly.
Any help would be much more appreciated.

A
Abul author 3/11/2014



Hello Dear,

I got stuck at the end of my order submit app development. Please help me out. After submission an order customer needs to have the whole order information in a pdf file. In order to available this feature, I need to insert a BUTTON or any link text like "Print Pdf" in the grid of the order list page. I need this button to fire up an external order_pdf.php (a custom pdf writing file created by FPDF lib and example Mysql Table) page to create whole purchase order in pdf on the fly.
I have created order_view table in my database from order, customer, products and billing info tables. I am using this order_view table to retrieve whole order information into my order_pdf.php page by sql query with WHERE clause such as:

$pdf->Table("select ordno, fname, lname from ord_view where ord_id=".$ord_id,$prop);


The ord_id field in order_view table is the alais field of "id" (order table). I am trying to pass order (id) from the order list page to my order_pdf.php page by using $_GET['id'] with no luck on button click. And even the button is not working with $_GET['ord_id']. However, if I run a url like http://localhost/test/order_pdf.php?ord_id=2 or 3 then it works but the button click is not functioned. I used so many tips from the forum such as this and this probably more potential with no luck.
So basically I just need to insert a button for each record on order list page and have that button pass the ID of the record, so my external order_pdf.php page can be run to produce whole order pdf on the fly.
Any help would be much more appreciated.


I have solved this issue. I just follow the tips of admin in the forum here and its worked like a rock. Thanks admin.

A
Abul author 3/11/2014



I have solved this issue. I just follow the tips of admin in the forum here and its worked like a rock. Thanks admin.


Now I am facing new issue. I see this method pass my record id through URL and it seems to me insecure. Any one can login and can find order info for another user just by changing id value at the end. Now my question how can I secure this URL so that one user cannot not access another users record. Thanks in advance.