This topic is locked

Print button to redirect another page

3/6/2014 11:20:03 AM
PHPRunner General questions
A
Abul author

I have an issue to redirect to another page from a PRINT button. My conditions are as follows:

  1. I have created Order_view table from order, order detail, customer and billing tables.
  2. I have created a separate order_pdf.php page based on FPDF lib and Order_view table.
  3. I put $ord_id=$_GET["ord_id"]; and SELECT query with (where ord_id=".$ord_id,) in order_pdf.php file.
  4. I inserted a PRINT button on the grid of order list page for each order.
  5. Now I want customer to click on the PRINT button to activate order_pdf.php page to open a pdf file for that order with all related information.
    My PRINT button code as:
    Onserver event:

$record=$button->getCurrentRecord();

$result[“ord_id”]=$record[“id”]; (ord_id in order_view table is alias name for “id” in order table)


ClientAfter events:

Location.href=’order_pdf.php?ord_id=’+result[“ord_id”];


Unfortunately this button does not produce any result but mysql syntax error where ord_id=. I think I cannot pass the parameter to my order_pdf.php file correctly.
If I run the same order_pdf.php page from separate window with URL //localhost/order_pdf.php?ord_id=my ord_id directly then it produces result based on changing ord_id on URL.
I also tried the button without #3 option and that also didn’t produce any result or error.
I would be highly grateful if any one please give me a solution. Sorry for this inconvenience.