CC-2755: Displaying trial ending information

- it only displays about remaining date when the plan level is 'trial'
This commit is contained in:
James 2011-09-02 12:10:46 -04:00
parent 1a8214fccc
commit ce2ce0a13a
5 changed files with 32 additions and 2 deletions

View File

@ -10,7 +10,7 @@
<div id="Panel">
<div class="logo"></div>
<?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "trial_remain"=> $this->trialRemaining())) ?>
<?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?>
<?php $partial = array('menu.phtml', 'default');
$this->navigation()->menu()->setPartial($partial); ?>

View File

@ -10,7 +10,7 @@
<div id="Panel">
<div class="logo"></div>
<?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "trial_remain"=> $this->trialRemaining())) ?>
<?php echo $this->partial('partialviews/header.phtml', array("user" => $this->loggedInAs(), "is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?>
<?php $partial = array('menu.phtml', 'default');
$this->navigation()->menu()->setPartial($partial); ?>

View File

@ -0,0 +1,12 @@
<?php
class Airtime_View_Helper_IsTrial extends Zend_View_Helper_Abstract{
public function isTrial(){
$plan = Application_Model_Preference::GetPlanLevel();
if($plan == 'trial'){
return true;
}else{
return false;
}
}
}

View File

@ -0,0 +1,16 @@
<?php
class Airtime_View_Helper_TrialRemaining extends Zend_View_Helper_Abstract
{
public function trialRemaining()
{
$ending_date = Application_Model_Preference::GetTrialEndingDate();
$datetime1 = new DateTime();
$datetime2 = new DateTime($ending_date);
$interval = $datetime1->diff($datetime2);
if($interval->format('%R') == '-'){
return "Trial expired.";
}
return $interval->format('%a days');
}
}

View File

@ -30,12 +30,14 @@
<li class="time-zone"><span id="time-zone"></span></li>
</ul>
</div>
<?php if($this->is_trial){?>
<div class="trial-info-block">
<ul>
<li>Trial remaining</li>
<li><?php echo $this->trial_remain?></li>
</ul>
</div>
<?php }?>
<div class="personal-block">
<ul>
<li><a id="about-link" href="#">About</a></li>