Jump to content

If stage = delivered does not work in quotepdf.tpl


Tapeix

Recommended Posts

Full code:

 

if ($stage == "Delivered") {
$noteshtml = '<table width="100%" cellspacing="1" cellpadding="2" border="0"> blablabla </table>'; } 
elseif ($stage == "Draft") {
$noteshtml = '<table width="100%" cellspacing="1" cellpadding="2" border="0"> blablabla </table>'; } else { blablabla }

 

Even if I try to convert it to html, the variable does not appear.

 

$noteshtml = '{if $stage == "Delivered"}	
<table width="100%" cellspacing="1" cellpadding="2" border="0"> blablabla </table>
{elseif $stage == "Draft"}
<table width="100%" cellspacing="1" cellpadding="2" border="0"> blablabla </table>
{else} {/if}';

 

What did I do wrong?

Link to comment
Share on other sites

Sure, full code posted below.

 

# Quote Items above this line (@sentq!)

$pdf->writeHTML($tblhtml, true, false, false, false, '');

$pdf->Ln(5);

# Transactions
# Removed!

# Terms

if ($stage == "Delivered") {
   $noteshtml = '	
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
           <tr>
               <td>'.$_LANG["offerteb1"].' '.$validuntil.' '.$_LANG["offerteb2"].' <br><br>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
           </tr>
       </table>
   ';
} elseif ($stage == "Draft") {
   $noteshtml = '	
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
               <tr>
               <td>'.$_LANG["offerteb1"].' '.$validuntil.' '.$_LANG["offerteb2"].' <br><br>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
               </tr>
           </table>
   ';
} else {
   $noteshtml = '	
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
               <tr>
               <td>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
               </tr>
           </table>
   ';
}

$pdf->writeHTML($noteshtml, true, false, false, false, '');

Edited by Tapeix
Link to comment
Share on other sites

are you saying the above code doesn't work? it looks fine to me... though if delivered and draft are going to be the same, i'd combine them into one if statement - but that won't be why it isn't working.

 

if ($stage == "Delivered" || $stage == "Draft") {
   $noteshtml = '    
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
           <tr>
               <td>'.$_LANG["offerteb1"].' '.$validuntil.' '.$_LANG["offerteb2"].' <br><br>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
           </tr>
       </table>
   ';
} else {
   $noteshtml = '    
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
               <tr>
               <td>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
               </tr>
           </table>
   ';
}

 

$pdf->writeHTML($noteshtml, true, false, false, false, ''); [/php]

Link to comment
Share on other sites

It isn't working, indeed. You may try the code below yourself by using this code in quotepdf.tpl.

 

<?php

# Terms

if ($stage == "Delivered" || $stage == "Draft") {
   $noteshtml = '    
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
           <tr>
               <td>'.$_LANG["offerteb1"].' '.$validuntil.' '.$_LANG["offerteb2"].' <br><br>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
           </tr>
       </table>
   ';
} else {
   $noteshtml = '    
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
               <tr>
               <td>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
               </tr>
           </table>
   ';
}

$pdf->writeHTML($noteshtml, true, false, false, false, '');

?>

Link to comment
Share on other sites

Works well. That isn't the problem.

 

'.$stage.' output = 'Afgeleverd' (--> delivered

 

- - - Updated - - -

 

Hahaha :D

 

I just made translated the variables to Dutch and it works. Probably because I'm using the Dutch admin translation.

 

if ($stage == "Afgeleverd" || $stage == "Concept" || $stage == "Delivered" || $stage == "Draft") {
   $noteshtml = '    
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
           <tr>
               <td>'.$_LANG["offerteb1"].' '.$validuntil.' '.$_LANG["offerteb2"].' <br><br>'.$_LANG["invoicesnotes"].' '.$notes.'</td>
           </tr>
       </table>
   ';
} else {
   $noteshtml = '    
       <table width="100%" cellspacing="1" cellpadding="2" border="0">
               <tr>
               <td>'.$_LANG["invoicesnotes"].' '.$notes.' '.$stage.'</td>
               </tr>
           </table>
   ';
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated