<?php
 require_once('class.Tariff2.inc.php'); class OpTariff2 extends Tariff2 { public function __construct( $app) { parent::__construct( $app); $this->can_access = ValidateLevel( $this->owner->config['SECURITY']['RESELLER_OPERATORS']); $this->can_add = ValidateLevel( $this->owner->config['SECURITY']['PROVIDER_OPERATORS']+LVL_ADD); $this->can_edit = ValidateLevel( $this->owner->config['SECURITY']['PROVIDER_OPERATORS']+LVL_EDIT); $this->can_remove = ValidateLevel( $this->owner->config['SECURITY']['PROVIDER_OPERATORS']+LVL_REMOVE); } protected function int_show($page=0) { $a = $this->db->get_records_for_operator( $this->owner->config['LINES_PER_PAGE'], $page); $recs = $a[0]; $allRecs = $a[1]; if ($this->can_add) array_push($this->owner->pan_menu,array('rad.Tariff2.add&amp;page='.$page,'bbar/add.png',STR_CMMN_NEW)); $this->owner->pager('rad.'.get_class($this).'.table_view', $recs, $page); if (count($allRecs) > 0) { $obj = $this->owner->load_object_resource('rad.Reports2'); for ($i = 0; $i < count($allRecs); $i++) { if ( $allRecs[$i][6] == 0) $allRecs[$i][6] = STR_GRP_UNLIM; else $allRecs[$i][6] = $allRecs[$i][6]/86400; $tmp = $allRecs[$i][8]; if ( $allRecs[$i][8] == '1') $allRecs[$i][8] = GetImage('lock.png'); else $allRecs[$i][8] = ''; if ($this->can_access && $allRecs[$i][2] != 0) $allRecs[$i][8] .= '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?q=sys.Price2.edit&amp;gid='.$allRecs[$i][0].'&amp;tos='.$allRecs[$i][2].'&amp;dir='.$tmp.'&amp;return=rad.OpTariff2.table_view&amp;service=rad" >'.GetImage('money.png').'</a>&nbsp;'; if ( ($allRecs[$i][2] != 0) && ($allRecs[$i][2] != 1) && ($allRecs[$i][2] != 5)) $allRecs[$i][2] = $this->t_types[$allRecs[$i][2]][1] .' => '. $this->d_types[$tmp][1]; else $allRecs[$i][2] = $this->t_types[$allRecs[$i][2]][1]; if ( $allRecs[$i][3] == 0) $allRecs[$i][3] = $this->f_types[$allRecs[$i][3]][1]; else $allRecs[$i][3] = $this->f_types[$allRecs[$i][3]][1] . ' => ' . $allRecs[$i][9]; $allRecs[$i][7] = $this->get_track_users_from_gid( $allRecs[$i][0], $allRecs[$i]['users_col']); $allRecs[$i][8] .= $obj->about_users(0, $allRecs[$i][0], 0, $allRecs[$i][1], '', $allRecs[$i]['users_col']).'&nbsp;'.$obj->act_value(0, '', $allRecs[$i][0], 0, $allRecs[$i][1], $allRecs[$i]['users_col']); } $allName = array( 0 => STR_CMMN_ID, 1 => STR_GRP_TITLE, 2 => STR_GRP_BILL_FOR, 3 => STR_GRP_BILL_FIXED, 4 => STR_GRP_DEPOSIT, 5 => STR_GRP_CREDIT, 6 => STR_GRP_ACTIVATION, 7 => STR_GRP_USERS, 8 => STR_CMMN_OPTIONS ); $this->owner->print_array_as_table($allName, $allRecs, STR_GRP_TABLETITLE, sprintf(STR_CMMN_TOTAL,$recs)); } else $this->owner->info_msg(STR_CMMN_NOTFOUND); } } ?>
