<?php
 require_once('class.OpUsed2.inc.php'); class RecUsed2 extends OpUsed2 { public function __construct( $app) { parent::__construct( $app); $this->owner->set_help( get_class($this)); $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']['RESELLER_OPERATORS']+LVL_EDIT); $this->can_remove = ValidateLevel( $this->owner->config['SECURITY']['SYSTEM_OPERATORS']+LVL_REMOVE); } protected function int_searchform( $id='', $page=-1, $val1='', $val2='', $exact=0, $tmp='') { if ( $page >= 0) array_push($this->owner->pan_menu,array('rad.Actions2.table_view&amp;page='.$page.'&amp;user='.$id,'bbar/table.png',STR_CMMN_TABLE)); $a = $this->owner->db->GetAll( "SELECT orgunit FROM sk_objects WHERE obj_id='".$GLOBALS['SSXID']."'"); $Template = $this->owner->load_template_resource(array('hForm'=>'rused2')); $Template->set_var('VAL_FORMACTION', Linkage()); $Template->set_var('LS_PATH', $this->owner->get_ls_path()); $this->owner->page_title = STR_USR_SEARCH; $Template->set_var('TXT_SEARCH1', STR_USR_SEARCH1); $Template->set_var('TXT_SEARCH2', STR_USR_SEARCH2); $Template->set_var('TXT_MONTH', $this->owner->get_month_combo(date('n')-1)); $Template->set_var('BTN_SEARCH', STR_CMMN_SEARCH); $Template->set_var('HIDDEN_VARS', '
		<input type="hidden" name="q" value="rad.'.get_class($this).'.table_view" />
<input type="hidden" name="classname" value="'.get_class($this).'" />
<input type="hidden" name="id" value="'.$a[0][0].'" />
'); $Template->pparse('out', 'hForm'); } public function table_view() { if ( !$this->can_access) { $this->owner->permission_denied(); return; } if ( isset($GLOBALS['page'])) $page = $GLOBALS['page']; else $page = -1; if ( isset($GLOBALS['id'])) $id = $GLOBALS['id']; else { $this->owner->permission_denied(); return; } call_user_func(array($this,'int_show'), $id, $page, $GLOBALS['choice'], $GLOBALS['month']); } protected function int_show($id='', $page=0, $exact=0, $month=0) { $a = $this->db->get_records_for_lowlevel( $this->owner->config['LINES_PER_PAGE'], $page, $month, $exact); $recs = $a[0]; $allRecs = $a[1]; $recs = 0; if (count($allRecs) > 0) { $obj = $this->owner->load_object_resource('rad.Reports2'); for ($i = 0; $i < count($allRecs); $i++) { $recs ++; if ($this->can_edit) $allRecs[$i][2] = '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?q=rad.Tariff2.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.User2.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 dislog('".STR_CMMN_DELETE."', '".$allRecs[$i][1]." ?', '".$_SERVER['PHP_SELF']."?q=rad.User2.delete&amp;id=".$allRecs[$i][0]."&amp;user=".$allRecs[$i][1]."&amp;page=0')\" href=# >".GetImage('delete.png').'</a>&nbsp;'; if ($this->can_access && $allRecs[$i][11] != 0) $allRecs[$i][10] .= '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?q=rad.Actions2.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]); } $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); } } ?>
