jon-e2 Posted February 3, 2010 Share Posted February 3, 2010 (edited) Hello, I am trying to create an element of our dashboard that displays only invoices that are past due. Since the {$todaysdate} is a different format than {$invoices.datedue} I am using {$smarty.now|date_format:" %m/%d/%G"} which works great. The way I am going about this is with the if rule. I want it to display the notice that there is a past due invoice IF{$invoices.datedue} is past {$smarty.now|date_format:" %m/%d/%G"} First code i tried was: {if $smarty.now|date_format:" %m/%d/%G" gte $invoice.datedue} <div class="box-notice"> whoah dude you owe us some cash </div> {/if} But then I noticed that it wouldn't know what invoice it to look at So I tried {if $smarty.now|date_format:" %m/%d/%G" gte {foreach key=num item=invoice from=$invoices}$invoice.datedue{/foreach}} <div class="box-notice"> whoah dude you owe us some cash </div> {/if} Which is causing some sort of issue loading the page now. SO i was wondering if you had any insight as to what I am doing wrong or how I need to change this code for it to work correctly. Thanks. Edited February 3, 2010 by jon-e2 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.