<?php
 require_once('class.ProvUser2.inc.php'); class OpUser2 extends ProvUser2 { 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']['RESELLER_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($gid, $sid, $page=0, $user) { $a = $this->dbr->get_records_for_lowlevel( $this->owner->config['LINES_PER_PAGE'], $page, $gid, $sid, $user); $recs = $a[0]; $allRecs = $a[1]; if ($this->can_add) array_push($this->owner->pan_menu,array('rad.'.get_class($this).'.add&amp;page='.$page,'bbar/add.png',STR_CMMN_NEW)); if ( $this->can_access) array_push($this->owner->pan_menu,array('rad.'.get_class($this).'.search&amp;page='.$page.'&amp;sid='.$sid.'&amp;gid='.$gid,'bbar/search.png',STR_CMMN_FIND)); $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++) { $allRecs[$i][6] = $allRecs[$i][6] . ' / '. $allRecs[$i]['last_info']; if ($this->can_edit) $allRecs[$i][2] = '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?q=rad.OpTariff2.edit&amp;id='.$allRecs[$i][11].'&amp;page='.$page.'" >'.$allRecs[$i][2].'</a>&nbsp;'; $allRecs[$i][8] = (round($allRecs[$i][8]/1024/1024,0)); if ( $allRecs[$i][10] == '1') $allRecs[$i][10] = GetImage('lock.png'); else $allRecs[$i][10] = ''; if ($this->can_edit) $allRecs[$i][10] .= '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?q=rad.'.get_class($this).'.edit&amp;id='.$allRecs[$i][0].'&amp;page='.$page.'" >'.GetImage('edit.png').'</a>'; if ($this->can_remove) $allRecs[$i][10] .= "&nbsp;<a onclick=\"javascript: return dialog('".STR_CMMN_DELETE."', '".$allRecs[$i][1]." ?', '".$_SERVER['PHP_SELF']."?q=rad.".get_class($this).".delete&amp;id=".$allRecs[$i][0]."&amp;user=".$allRecs[$i][1]."&amp;page=0')\" href=# >".GetImage('delete.png').'</a>&nbsp;'; if ($this->can_access && !empty($allRecs[$i][6])) { $allRecs[$i][10] .= '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?q=rad.OpActions2.table_view&amp;user='.$allRecs[$i][1].'&amp;page=0" >'.GetImage('history.png').'</a>&nbsp;'; $allRecs[$i][10] .= $obj->act_value(0, $allRecs[$i][1]); } $allRecs[$i][10] .= $this->link_2_obj($allRecs[$i]['account_id']); } $allName = array( 0 => STR_CMMN_ID, 1 => STR_USR_TITLE, 2 => STR_USR_GRP, 3 => STR_USR_DEPOSIT, 4 => STR_USR_CREDIT, 5 => STR_USR_EXPIRED, 6 => STR_USR_LAST, 7 => STR_USR_ALL_TIME, 8 => STR_USR_ALL_TRAFFIC, 9 => STR_USR_ALL_MONEY, 10 => STR_CMMN_OPTIONS ); $this->owner->print_array_as_table($allName, $allRecs, STR_USR_TABLETITLE, sprintf(STR_CMMN_TOTAL,$recs)); } else $this->owner->info_msg(STR_CMMN_NOTFOUND); } } ?>
