403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/hkosl.com/nick/codeigniter/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/nick/codeigniter/application/controllers//Home.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends CI_Controller
{

    public function index()
    {
        /**
         * Pass data to views
         * 1. Option one
         * $data['anything'] = 'You can put data here';
         * $this->load->view('main/home', $data);
         *
         * 2. Option two
         * $anything = 'You can put data here';
         * $this->load->vars('anything', $anything);
         *
         * Example:https://codeigniter.com/userguide3/tutorial/news_section.html
         * Ref:https://codeigniter.com/userguide3/libraries/loader.html#CI_Loader::vars
         *
         */

        $data['anything'] = 'You can put data here';

        $site_info = Site_info_model::first();

        $this->load->vars('lang', get_lang());
        $this->load->vars('site_info', $site_info);
        // same with $data['site_info'], you can call $site_info on views/main/home.php

        $this->load->view('main/home', $data);
        //on application/views/main/home.php, you can call $anything.
    }

    public function send_email()
    {
        /**
         * Email Class
         * Ref:https://codeigniter.com/userguide3/libraries/email.html
         *
         */

        $this->load->config('email');

        $from = 'from@email.com';
        $from_name = 'from';
        $to = 'to@email.com';
        $subject = 'Title';
        $message = 'This is content';
        $result = ci_send_email($from, $from_name, $to, $subject, $message);

        if ($result) {
            echo "Success";
        } else {
            echo "Failed";
        }
    }

    public function pagination_demo($page = 1)
    {
        /**
         * Pagination Class
         * Ref:https://www.codeigniter.com/userguide3/libraries/pagination.html
         *
         */
        $per_page = 2; //how many items you want to show for each page

        $query = News_model::where('deleted', 0);
        $count = $query->count();
        $news = $query->take($per_page)->skip($per_page * ($page - 1))->get();
        $this->load->vars('news', $news);

        $this->load->library('pagination');

        $config['base_url'] = front_url('home/pagination_demo/'); //pagination url
        $config['total_rows'] = $count;
        $config['per_page'] = $per_page;
        $config['use_page_numbers'] = true;
        /* This Application Must Be Used With BootStrap 3 *  */
        $config['full_tag_open'] = "<ul class='pagination'>";
        $config['full_tag_close'] = "</ul>";
        $config['num_tag_open'] = '<li>';
        $config['num_tag_close'] = '</li>';
        $config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
        $config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
        $config['next_tag_open'] = "<li>";
        $config['next_tagl_close'] = "</li>";
        $config['prev_tag_open'] = "<li>";
        $config['prev_tagl_close'] = "</li>";
        $config['first_tag_open'] = "<li>";
        $config['first_tagl_close'] = "</li>";
        $config['last_tag_open'] = "<li>";
        $config['last_tagl_close'] = "</li>";

        $this->pagination->initialize($config);

        $page_links = $this->pagination->create_links();
        $this->load->vars('page_links', $page_links);
        $this->load->view('main/news');
    }

    public function ci_database($page = 1)
    {
        /**
         * Query Builder Class
         * Ref:https://codeigniter.com/userguide3/database/query_builder.html
         *
         */
        $per_page = 2; //how many items you want to show for each page

        $count = $this->db->where('deleted', 0)->get('news')->num_rows();
        $news = $this->db->where('deleted', 0)->get('news', $per_page, $per_page * ($page - 1))->result();
        $this->load->vars('news', $news);

        $this->load->library('pagination');

        $config['base_url'] = front_url('home/ci_database/'); //pagination url
        $config['total_rows'] = $count;
        $config['per_page'] = $per_page;
        $config['use_page_numbers'] = true;
        /* This Application Must Be Used With BootStrap 3 *  */
        $config['full_tag_open'] = "<ul class='pagination'>";
        $config['full_tag_close'] = "</ul>";
        $config['num_tag_open'] = '<li>';
        $config['num_tag_close'] = '</li>';
        $config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>";
        $config['cur_tag_close'] = "<span class='sr-only'></span></a></li>";
        $config['next_tag_open'] = "<li>";
        $config['next_tagl_close'] = "</li>";
        $config['prev_tag_open'] = "<li>";
        $config['prev_tagl_close'] = "</li>";
        $config['first_tag_open'] = "<li>";
        $config['first_tagl_close'] = "</li>";
        $config['last_tag_open'] = "<li>";
        $config['last_tagl_close'] = "</li>";

        $this->pagination->initialize($config);

        $page_links = $this->pagination->create_links();
        $this->load->vars('page_links', $page_links);
        $this->load->view('main/news');
    }

    public function captcha($action = '')
    {
        /** CAPTCHA Helper
         * Ref: https://www.codeigniter.com/userguide3/helpers/captcha_helper.html
         * Directory of assets/captcha must be exist
         *
         */

        if ($action == 'check') {
            $this->form_validation->set_rules('captcha_code', 'Captcha code', 'trim|required');
            if ($this->form_validation->run() == false) {
                echo validation_errors();
            } elseif (captcha_checking()) {
                echo "Correct!";
            } else {
                //$this->session->flashdata('error_msg');//default error message
                echo "Failed!";
            }
        }

        $captcha = captcha_img();
        echo $captcha;
        echo form_open(front_url('home/captcha/check'));
        echo form_input(array(
            'type'  => 'text',
            'name'  => 'captcha_code',
            'class' => 'form-control',
        ));
        echo form_button(array(
            'type'    => 'submit',
            'content' => 'Verify',
            'class'   => 'btn btn-primary',
        ));
        echo form_close();
    }

    public function testing()
    {
        $this->load->view('webadmin/invoice_export');
    }

    public function phpinfo()
    {
        phpinfo();
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit