We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Inventory Hours - Simple Calculation with PHP

Development and Programming

CDT's avatar
CDT
93 posts
15 years ago
CDT's avatar CDT

Fixed it. In case anyone else wants to do something similar:

{exp:channel:entries site="siteorders" channel="customer_complete" show_future_entries="yes" dynamic="off" disable="categories|trackbacks|pagination|category_fields" rdf="off" status="open"}
{if "{count}" == "1"}
    {if total_results == "1"}
        <?php $total_projects = "1" ; ?>
    {if:else}
        <?php $total_projects = "{total_results}" ; ?>
    {/if}
{/if}
{/exp:channel:entries}

<?php $work_days = ($total_projects * 2); ?>
<?php $delivery_days = ($work_days + 1); ?>

<?php 
    $start_day = 
        $this->EE->localize->decode_date('%l
 %F %j, %Y', 
            $this->EE->localize->now +  ((86400 * $work_days) + 86400)); 
?>

Orders finalized today

    will be delivered no later than

    <?php echo $start_day; ?>.

Yields:

Orders finalized today will be delivered no later than Tuesday March 15, 2011.
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.