コード例 #1
0
ファイル: evote.php プロジェクト: SelFish131/rf_office
 function getbonus()
 {
     if (!is_logged()) {
         redirect(base_url());
     }
     include APPPATH . "config/evote.php";
     $this->data['title'] = lang('off_vote');
     $text = icon('64x64/chart_up.png') . '<h2>Голосование на TOP EMUDEV</h2><p>После голосования нажмите получить бонус.</p>';
     $char = (int) office_secure($this->input->post('char'));
     if ($char <= 0) {
         redirect('evote');
     }
     $query = $this->MSSQL->query("SELECT Name FROM " . get_world() . ".dbo.tbl_base WHERE Serial='{$char}'");
     if ($query->num_rows() > 0) {
         foreach ($query->result() as $row) {
             $char = preg_name($row->Name);
         }
         //for
     } else {
         redirect('evote');
     }
     # Генерация полной ссылки текущего года/месяца
     $FullLink = $config['logfile'] . md5(date("Ym")) . '.txt';
     # Получение данных статистики
     $data = file_get_contents($FullLink);
     # Разбитие данных в строки массива
     $rows = explode("\r\n", $data);
     $find = 0;
     for ($i = 0; $i < count($rows) - 1; $i++) {
         $row = explode("\t", $rows[$i]);
         if ($row[3] == '') {
             continue;
         }
         if ($row[3] == $char) {
             if (!$this->_id_exits($row[0])) {
                 $find++;
                 $text .= br(1) . icon('32x32/accept.png') . 'Бонус выдан';
                 if ($row[4] == 0) {
                     $summ = $config['normal'];
                 } else {
                     $summ = $config['sms'];
                 }
                 bonus_add(Get_AccountSerial(), $summ);
                 $this->_accepted($row);
             }
         }
     }
     //for
     if ($find == 0) {
         $text .= br(1) . icon('32x32/delete.png') . 'Голос не найден';
     }
     $this->data['content'] = $text;
     compile();
 }
コード例 #2
0
ファイル: main_index.php プロジェクト: SelFish131/rf_office
 function lostpassword()
 {
     $stop = '';
     $user = get_user();
     $text = '';
     $login = office_secure(trim($this->input->post('login', true)));
     $master_answer = md5(office_secure(trim($this->input->post('master_answer', true))));
     if ($login == '' || $this->input->post('master_answer') == '') {
         redirect('main_index/lost', 'refresh');
     }
     if (FastCheckBan(Get_AS(office_secure($login)))) {
         $stop = "You account is banned!";
     }
     $query_auth = $this->MSSQL->query("SELECT * FROM {$user}.dbo.tbl_UserAccount WHERE id = '" . xss_clean($login) . "'");
     if ($query_auth->num_rows() > 0) {
         foreach ($query_auth->result() as $row) {
             $seriala = $row->serial;
         }
         if (check_master_answer($seriala)) {
             $master_answer_query = show_master_answer($seriala);
         } else {
             $stop = lang('off_lost_error');
         }
     } else {
         $stop = lang('off_lost_error');
     }
     if ($stop == '') {
         $query = $this->MSSQL->query("SELECT id,Password FROM {$user}.dbo." . config('table_account', 'query') . " WHERE id = '" . $login . "'");
         if ($query->num_rows() > 0) {
             foreach ($query->result() as $row) {
                 $id_query = $row->id;
                 $Password_query = $row->Password;
             }
         } else {
             $stop = lang('off_lost_error');
         }
     }
     if ($stop == '') {
         if ($master_answer_query == $master_answer) {
             if (preg_name($Password_query) == '') {
                 exit('Permabanned!');
             }
             $this->session->set_userdata('login', xss_clean($login));
             $this->session->set_userdata('passw', xss_clean($Password_query));
             $this->session->set_userdata('lost_p', xss_clean($master_answer));
             redirect('main', 'refresh');
         } else {
         }
     } else {
         $text = $stop;
     }
     $this->data['content'] = icon('64x64/delete_user.png') . br(2) . go_back('', true) . $text;
     compile();
 }
コード例 #3
0
ファイル: main.php プロジェクト: SelFish131/rf_office
 function char($serial)
 {
     if (!is_numeric($serial)) {
         redirect('main');
     }
     if (!secure_serial_check($serial)) {
         redirect('#warn');
     }
     //      заголовок страницы
     $this->data['title'] = lang('off_title_info');
     //      узнаЄм имена баз
     $world = get_world();
     $query = $this->MSSQL->query("\n        SELECT *\n        FROM {$world}.dbo.tbl_base, {$world}.dbo.tbl_general\n        WHERE {$world}.dbo.tbl_base.Account = '" . get_login() . "'\n        AND {$world}.dbo.tbl_base.Serial={$serial}\n        AND {$world}.dbo.tbl_base.Serial={$world}.dbo.tbl_general.Serial");
     $this->table->set_template(tpl_table());
     if ($query->num_rows() > 0) {
         foreach ($query->result() as $row) {
             if ($row->DCK == 0) {
                 $this->table->add_row(b(lang('off_char_name')), preg_name($row->Name));
             }
             $name = preg_name($row->Name);
             if ($row->DCK == 1) {
                 $this->table->add_row(b(lang('off_char_name')), icon('24x24/delete_user.png') . preg_name($row->DeleteName));
             }
             $this->table->add_row(b(lang('off_char_race')), get_race($row->Race));
             $this->table->add_row(b(lang('off_char_totalp')), get_total_min($row->TotalPlayMin));
             $this->table->add_row(b(lang('off_char_guild')), get_guild($row->GuildSerial));
             $this->table->add_row(b(lang('off_char_pvp')), round($row->PvpPoint));
             $this->table->add_row(b(lang('off_char_class')), get_rfclass($row->Class));
             $this->table->add_row(b(lang('off_char_level')), $row->Lv);
             $this->table->add_row(b(lang('off_char_money')), $row->Dalant);
             $this->table->add_row(b(lang('off_char_gold')), $row->Gold);
             $this->table->add_row(b(lang('off_char_create')), $row->CreateTime);
             if (is_online($row->Serial) == true) {
                 $stat = icon('32x32/globe.png') . b(lang('off_char_online'));
             } else {
                 $stat = icon('32x32/globe_warning.png') . b(lang('off_char_offline'));
             }
             $this->table->add_row(b(lang('off_acc_stat')), $stat);
         }
         $this->data['content'] = icon('64x64/user.png') . $this->table->generate() . ItemsInChar($name);
     } else {
         $this->data['content'] = icon('32x32/red_button.png') . lang('off_error');
     }
     compile();
 }
コード例 #4
0
ファイル: mmotop.php プロジェクト: SelFish131/rf_office
 function _chararray($login = '')
 {
     $char = array();
     $login = preg_name(office_secure($login));
     $query = $this->MSSQL->query("SELECT Serial,Name FROM " . get_world() . ".dbo.tbl_base WHERE Account='{$login}' AND DCK=0");
     if ($query->num_rows() > 0) {
         foreach ($query->result() as $row) {
             $char[$row->Serial] = $row->Name;
         }
         //for
     } else {
         return false;
     }
     //if
     return $char;
 }
コード例 #5
0
function ru_text($text, $html1 = "<b>", $html2 = "</b>")
{
    $string = preg_name(trim($text));
    $rulang = "йцукенгшщзхфывапролджэ¤чсмитьбю…÷” ≈Ќ√Ўў«’Џ‘џ¬јѕ–ќЋƒ∆Ёя„—ћ»“№Ѕё";
    $ru_array = str_split($rulang);
    $i = 0;
    while ($i < count($ru_array)) {
        $string = str_replace($ru_array[$i], $html1 . $ru_array[$i] . $html2, $string);
        ++$i;
    }
    return $string;
}