Skip to content

Commit

Permalink
Show reseller it's status
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Sep 18, 2014
1 parent 7f0f7cd commit a9f21fe
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
11 changes: 10 additions & 1 deletion instancecustomer/classes/erlhcoreclassmodelinstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ public function __get($var) {
$this->is_active = $this->request > 0 && $this->expires > time() && $this->suspended == 0 && $this->reseller_suspended == 0;
return $this->is_active;
break;


case 'reseller_instances_count':
$db = ezcDbInstance::get();
$cfg = erConfigClassLhConfig::getInstance();
$db->query('USE '.$cfg->getSetting( 'db', 'database' ));
$this->reseller_instances_count = self::getCount(array('filter' => array('reseller_id' => $this->id)));
$db->query('USE '.$cfg->getSetting( 'db', 'database_user_prefix').erLhcoreClassInstance::$instanceChat->id);
return $this->reseller_instances_count;
break;

default:
;
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<h1><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit','Billing');?></h1>

<table class="large-6">
<?php if ($instance->is_reseller) : ?>
<tr>
<td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit','Instances');?></td>
<td><?php echo $instance->reseller_instances_count?>/<?php echo $instance->reseller_max_instances?></td>
</tr>
<tr>
<td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit','Request left to sell');?></td>
<td><?php echo $instance->reseller_request?></td>
</tr>
<tr>
<td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit','Max request per instance');?></td>
<td><?php echo $instance->reseller_max_instance_request?></td>
</tr>
<?php endif; ?>
<tr>
<td><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit','Request left');?></td>
<td><?php echo $instance->request?></td>
Expand Down
12 changes: 12 additions & 0 deletions instancecustomer/translations/lt_LT/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
</context>
<context>
<name>instance/edit</name>
<message>
<source>Max request per instance</source>
<translation>Maksimalus užklausų skaičius per klientą</translation>
</message>
<message>
<source>Request left to sell</source>
<translation>Neparduotų užklausų skaičius</translation>
</message>
<message>
<source>Instances</source>
<translation>Klientai</translation>
</message>
<message>
<source>Billing</source>
<translation>Apmokėjimas</translation>
Expand Down

0 comments on commit a9f21fe

Please sign in to comment.