Tapeix Posted October 15, 2016 Share Posted October 15, 2016 (edited) I try to add the following to my quotepdf.tpl file. if ($stage == "Delivered") { } else { } Unfortunately, no action is given. Can someone help me out? Thank you. ps. using lowercase does not help. Edited October 15, 2016 by Tapeix 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 16, 2016 Share Posted October 16, 2016 the right syntax is {if $stage == "Delivered"} Do Something {else} Do Something Else {/if} 0 Quote Link to comment Share on other sites More sharing options...
Tapeix Posted October 16, 2016 Author Share Posted October 16, 2016 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? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 16, 2016 Share Posted October 16, 2016 your IF statement is the right one indeed, I was confused you may include full code 0 Quote Link to comment Share on other sites More sharing options...
Tapeix Posted October 16, 2016 Author Share Posted October 16, 2016 (edited) 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 October 16, 2016 by Tapeix 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 16, 2016 Share Posted October 16, 2016 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] 0 Quote Link to comment Share on other sites More sharing options...
Tapeix Posted October 16, 2016 Author Share Posted October 16, 2016 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, ''); ?> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 16, 2016 Share Posted October 16, 2016 it works fine in v6 - so i'm wondering if it's a bug in v7 or its now called something else? have you tried outputting $stage to see if the variable exists ? 0 Quote Link to comment Share on other sites More sharing options...
Tapeix Posted October 16, 2016 Author Share Posted October 16, 2016 Works well. That isn't the problem. '.$stage.' output = 'Afgeleverd' (--> delivered - - - Updated - - - Hahaha 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> '; } 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.