delete the first blank line in and any space in pdf.php
------
<?php
--------script must be start clear
<?php
I have it working now thanks, but it doesn't display Messages and Responses correctly:
Messages are Users replys to a ticket
Responses are Staff replys to a ticket
I was my PDF to output just either the users 1st message only or the Staffs 1st message (Which is actually the second) as the Logged by admin is the first ie
When a Staff member logs a call the message automatically becomes "Ticket Created by Admin" and then a response below is added with a description of the ticket problem
When a client logs a call the message becomes a description of the ticket problem
I just want either the Users first Message or the Staffs 2nd Response (As the first response when logging a tciket by staff is "Ticket Created by Admin"
My PDF code for this message section is:
// Fetch Message from DB
$sql='SELECT msg.msg_id,msg.created,msg.message,count(attach_id) as attachments FROM '.TICKET_MESSAGE_TABLE.' msg '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON msg.ticket_id=attach.ticket_id AND msg.msg_id=attach.ref_id AND ref_type='M' ".
' WHERE msg.ticket_id='.db_input($id).
' GROUP BY msg.msg_id ORDER BY created';
$msgres =db_query($sql);
while ($msg_row = db_fetch_array($msgres)) {
$message_row=$msg_row;
$message = str_replace("\n\r", "$pdf->Ln", $message_row);
$message = str_replace('„', '"', $message_row);
$message = str_replace('•', '-->', $message_row);
$message = str_replace('€', ' Euro', $message_row);
$message = str_replace('„', '"', $message_row);
$pdf->drawTextBox(utf8_decode($message), 174,'L', 'T',1);
$pdf->Setx(18);
$pdf->drawTextBox("", 174,1, 'L', 'T',0);
//$pdf->MultiCell( 174, 5, utf8_decode($message) , '1', 'J', 0);
//$pdf->MultiCell( 174, 1, "" , '0', 'J', 0);
// get answers for messages
$sql='SELECT resp.*,count(attach_id) as attachments FROM '.TICKET_RESPONSE_TABLE.' resp '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON resp.ticket_id=attach.ticket_id AND resp.response_id=attach.ref_id AND ref_type='R' ".
' WHERE resp.ticket_id='.db_input($id).
' GROUP BY resp.response_id ORDER BY created';
$resp =db_query($sql);
while ($resp_row = db_fetch_array($resp)) {
$respID=$resp_row;
$response=$resp_row;
$pdf->Setx(18);
$pdf->drawTextBox(utf8_decode($response), 174, 'L', 'T',1);
Thanks